f089c536f5ff1bb3971c777d69bc168514f55c2c
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSFontMetrics.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/Common/FontMetrics")]
13     public class InternalFontMetricsTest
14     {
15         private const string tag = "NUITEST";
16
17         [SetUp]
18         public void Init()
19         {
20             tlog.Info(tag, "Init() is called!");
21         }
22
23         [TearDown]
24         public void Destroy()
25         {
26             tlog.Info(tag, "Destroy() is called!");
27         }
28
29         [Test]
30         [Category("P1")]
31         [Description("FontMetrics constructor.")]
32         [Property("SPEC", "Tizen.NUI.FontMetrics.FontMetrics C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void FontMetricsConstructor()
37         {
38             tlog.Debug(tag, $"FontMetricsConstructor START");
39
40             var testingTarget = new FontMetrics();
41             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
42             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
43
44             testingTarget.Dispose();
45             tlog.Debug(tag, $"FontMetricsConstructor END (OK)");
46         }
47
48         [Test]
49         [Category("P1")]
50         [Description("FontMetrics Ascender.")]
51         [Property("SPEC", "Tizen.NUI.FontMetrics.Ascender A")]
52         [Property("SPEC_URL", "-")]
53         [Property("CRITERIA", "PRW")]
54         [Property("AUTHOR", "guowei.wang@samsung.com")]
55         public void FontMetricsAscender()
56         {
57             tlog.Debug(tag, $"FontMetricsAscender START");
58
59             var testingTarget = new FontMetrics();
60             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
61             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
62
63             testingTarget.Ascender = 0.3f;
64             Assert.AreEqual(0.3f, testingTarget.Ascender, "Should be equal!");
65
66             testingTarget.Dispose();
67             tlog.Debug(tag, $"FontMetricsAscender END (OK)");
68         }
69
70         [Test]
71         [Category("P1")]
72         [Description("FontMetrics Descender.")]
73         [Property("SPEC", "Tizen.NUI.FontMetrics.Descender A")]
74         [Property("SPEC_URL", "-")]
75         [Property("CRITERIA", "PRW")]
76         [Property("AUTHOR", "guowei.wang@samsung.com")]
77         public void FontMetricsDescender()
78         {
79             tlog.Debug(tag, $"FontMetricsDescender START");
80
81             var testingTarget = new FontMetrics();
82             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
83             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
84
85             testingTarget.Descender = 0.3f;
86             Assert.AreEqual(0.3f, testingTarget.Descender, "Should be equal!");
87
88             testingTarget.Dispose();
89             tlog.Debug(tag, $"FontMetricsDescender END (OK)");
90         }
91
92         [Test]
93         [Category("P1")]
94         [Description("FontMetrics Height.")]
95         [Property("SPEC", "Tizen.NUI.FontMetrics.Height A")]
96         [Property("SPEC_URL", "-")]
97         [Property("CRITERIA", "PRW")]
98         [Property("AUTHOR", "guowei.wang@samsung.com")]
99         public void FontMetricsHeight()
100         {
101             tlog.Debug(tag, $"FontMetricsHeight START");
102
103             var testingTarget = new FontMetrics();
104             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
105             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
106
107             testingTarget.Height = 0.3f;
108             Assert.AreEqual(0.3f, testingTarget.Height, "Should be equal!");
109
110             testingTarget.Dispose();
111             tlog.Debug(tag, $"FontMetricsHeight END (OK)");
112         }
113
114         [Test]
115         [Category("P1")]
116         [Description("FontMetrics UnderlinePosition.")]
117         [Property("SPEC", "Tizen.NUI.FontMetrics.UnderlinePosition A")]
118         [Property("SPEC_URL", "-")]
119         [Property("CRITERIA", "PRW")]
120         [Property("AUTHOR", "guowei.wang@samsung.com")]
121         public void FontMetricsUnderlinePosition()
122         {
123             tlog.Debug(tag, $"FontMetricsUnderlinePosition START");
124
125             var testingTarget = new FontMetrics();
126             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
127             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
128
129             testingTarget.UnderlinePosition = 0.3f;
130             Assert.AreEqual(0.3f, testingTarget.UnderlinePosition, "Should be equal!");
131
132             testingTarget.Dispose();
133             tlog.Debug(tag, $"FontMetricsUnderlinePosition END (OK)");
134         }
135
136         [Test]
137         [Category("P1")]
138         [Description("FontMetrics UnderlineThickness.")]
139         [Property("SPEC", "Tizen.NUI.FontMetrics.UnderlineThickness A")]
140         [Property("SPEC_URL", "-")]
141         [Property("CRITERIA", "PRW")]
142         [Property("AUTHOR", "guowei.wang@samsung.com")]
143         public void FontMetricsUnderlineThickness()
144         {
145             tlog.Debug(tag, $"FontMetricsUnderlineThickness START");
146
147             var testingTarget = new FontMetrics();
148             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
149             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
150
151             testingTarget.UnderlinePosition = 0.1f;
152             Assert.AreEqual(0.1f, testingTarget.UnderlinePosition, "Should be equal!");
153
154             testingTarget.Dispose();
155             tlog.Debug(tag, $"FontMetricsUnderlineThickness END (OK)");
156         }
157     }
158 }