3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("internal/Common/FontMetrics")]
13 public class InternalFontMetricsTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
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()
38 tlog.Debug(tag, $"FontMetricsConstructor START");
40 var testingTarget = new FontMetrics();
41 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
42 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"FontMetricsConstructor END (OK)");
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()
57 tlog.Debug(tag, $"FontMetricsConstructorWithFloats START");
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.");
63 tlog.Debug(tag, "getCPtr : " + FontMetrics.getCPtr(testingTarget));
65 testingTarget.UnderlineThickness = 0.3f;
66 tlog.Debug(tag, "UnderlineThickness :" + testingTarget.UnderlineThickness);
68 testingTarget.Dispose();
69 tlog.Debug(tag, $"FontMetricsConstructorWithFloats END (OK)");
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()
81 tlog.Debug(tag, $"FontMetricsAscender START");
83 var testingTarget = new FontMetrics();
84 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
85 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
87 testingTarget.Ascender = 0.3f;
88 Assert.AreEqual(0.3f, testingTarget.Ascender, "Should be equal!");
90 testingTarget.Dispose();
91 tlog.Debug(tag, $"FontMetricsAscender END (OK)");
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()
103 tlog.Debug(tag, $"FontMetricsDescender START");
105 var testingTarget = new FontMetrics();
106 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
107 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
109 testingTarget.Descender = 0.3f;
110 Assert.AreEqual(0.3f, testingTarget.Descender, "Should be equal!");
112 testingTarget.Dispose();
113 tlog.Debug(tag, $"FontMetricsDescender END (OK)");
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()
125 tlog.Debug(tag, $"FontMetricsHeight START");
127 var testingTarget = new FontMetrics();
128 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
129 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
131 testingTarget.Height = 0.3f;
132 Assert.AreEqual(0.3f, testingTarget.Height, "Should be equal!");
134 testingTarget.Dispose();
135 tlog.Debug(tag, $"FontMetricsHeight END (OK)");
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()
147 tlog.Debug(tag, $"FontMetricsUnderlinePosition START");
149 var testingTarget = new FontMetrics();
150 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
151 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
153 testingTarget.UnderlinePosition = 0.3f;
154 Assert.AreEqual(0.3f, testingTarget.UnderlinePosition, "Should be equal!");
156 testingTarget.Dispose();
157 tlog.Debug(tag, $"FontMetricsUnderlinePosition END (OK)");
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()
169 tlog.Debug(tag, $"FontMetricsUnderlineThickness START");
171 var testingTarget = new FontMetrics();
172 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
173 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
175 testingTarget.UnderlinePosition = 0.1f;
176 Assert.AreEqual(0.1f, testingTarget.UnderlinePosition, "Should be equal!");
178 testingTarget.Dispose();
179 tlog.Debug(tag, $"FontMetricsUnderlineThickness END (OK)");