[NUI] Update TCs of NUI.Devel.
[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 constructor.")]
51         [Property("SPEC", "Tizen.NUI.FontMetrics.FontMetrics C")]
52         [Property("SPEC_URL", "-")]
53         [Property("CRITERIA", "CONSTR")]
54         [Property("AUTHOR", "guowei.wang@samsung.com")]
55         public void FontMetricsConstructorWithFloats()
56         {
57             tlog.Debug(tag, $"FontMetricsConstructorWithFloats START");
58
59             var testingTarget = new FontMetrics(0.3f, 0.1f, 0.5f, 0.9f, 0.0f);
60             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
61             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
62
63             tlog.Debug(tag, "getCPtr : " + FontMetrics.getCPtr(testingTarget));
64
65             testingTarget.UnderlineThickness = 0.3f;
66             tlog.Debug(tag, "UnderlineThickness :" + testingTarget.UnderlineThickness);
67
68             testingTarget.Dispose();
69             tlog.Debug(tag, $"FontMetricsConstructorWithFloats END (OK)");
70         }
71
72         [Test]
73         [Category("P1")]
74         [Description("FontMetrics Ascender.")]
75         [Property("SPEC", "Tizen.NUI.FontMetrics.Ascender A")]
76         [Property("SPEC_URL", "-")]
77         [Property("CRITERIA", "PRW")]
78         [Property("AUTHOR", "guowei.wang@samsung.com")]
79         public void FontMetricsAscender()
80         {
81             tlog.Debug(tag, $"FontMetricsAscender START");
82
83             var testingTarget = new FontMetrics();
84             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
85             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
86
87             testingTarget.Ascender = 0.3f;
88             Assert.AreEqual(0.3f, testingTarget.Ascender, "Should be equal!");
89
90             testingTarget.Dispose();
91             tlog.Debug(tag, $"FontMetricsAscender END (OK)");
92         }
93
94         [Test]
95         [Category("P1")]
96         [Description("FontMetrics Descender.")]
97         [Property("SPEC", "Tizen.NUI.FontMetrics.Descender A")]
98         [Property("SPEC_URL", "-")]
99         [Property("CRITERIA", "PRW")]
100         [Property("AUTHOR", "guowei.wang@samsung.com")]
101         public void FontMetricsDescender()
102         {
103             tlog.Debug(tag, $"FontMetricsDescender START");
104
105             var testingTarget = new FontMetrics();
106             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
107             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
108
109             testingTarget.Descender = 0.3f;
110             Assert.AreEqual(0.3f, testingTarget.Descender, "Should be equal!");
111
112             testingTarget.Dispose();
113             tlog.Debug(tag, $"FontMetricsDescender END (OK)");
114         }
115
116         [Test]
117         [Category("P1")]
118         [Description("FontMetrics Height.")]
119         [Property("SPEC", "Tizen.NUI.FontMetrics.Height A")]
120         [Property("SPEC_URL", "-")]
121         [Property("CRITERIA", "PRW")]
122         [Property("AUTHOR", "guowei.wang@samsung.com")]
123         public void FontMetricsHeight()
124         {
125             tlog.Debug(tag, $"FontMetricsHeight START");
126
127             var testingTarget = new FontMetrics();
128             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
129             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
130
131             testingTarget.Height = 0.3f;
132             Assert.AreEqual(0.3f, testingTarget.Height, "Should be equal!");
133
134             testingTarget.Dispose();
135             tlog.Debug(tag, $"FontMetricsHeight END (OK)");
136         }
137
138         [Test]
139         [Category("P1")]
140         [Description("FontMetrics UnderlinePosition.")]
141         [Property("SPEC", "Tizen.NUI.FontMetrics.UnderlinePosition A")]
142         [Property("SPEC_URL", "-")]
143         [Property("CRITERIA", "PRW")]
144         [Property("AUTHOR", "guowei.wang@samsung.com")]
145         public void FontMetricsUnderlinePosition()
146         {
147             tlog.Debug(tag, $"FontMetricsUnderlinePosition START");
148
149             var testingTarget = new FontMetrics();
150             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
151             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
152
153             testingTarget.UnderlinePosition = 0.3f;
154             Assert.AreEqual(0.3f, testingTarget.UnderlinePosition, "Should be equal!");
155
156             testingTarget.Dispose();
157             tlog.Debug(tag, $"FontMetricsUnderlinePosition END (OK)");
158         }
159
160         [Test]
161         [Category("P1")]
162         [Description("FontMetrics UnderlineThickness.")]
163         [Property("SPEC", "Tizen.NUI.FontMetrics.UnderlineThickness A")]
164         [Property("SPEC_URL", "-")]
165         [Property("CRITERIA", "PRW")]
166         [Property("AUTHOR", "guowei.wang@samsung.com")]
167         public void FontMetricsUnderlineThickness()
168         {
169             tlog.Debug(tag, $"FontMetricsUnderlineThickness START");
170
171             var testingTarget = new FontMetrics();
172             Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
173             Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
174
175             testingTarget.UnderlinePosition = 0.1f;
176             Assert.AreEqual(0.1f, testingTarget.UnderlinePosition, "Should be equal!");
177
178             testingTarget.Dispose();
179             tlog.Debug(tag, $"FontMetricsUnderlineThickness END (OK)");
180         }
181     }
182 }