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 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()
57 tlog.Debug(tag, $"FontMetricsAscender START");
59 var testingTarget = new FontMetrics();
60 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
61 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
63 testingTarget.Ascender = 0.3f;
64 Assert.AreEqual(0.3f, testingTarget.Ascender, "Should be equal!");
66 testingTarget.Dispose();
67 tlog.Debug(tag, $"FontMetricsAscender END (OK)");
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()
79 tlog.Debug(tag, $"FontMetricsDescender START");
81 var testingTarget = new FontMetrics();
82 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
83 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
85 testingTarget.Descender = 0.3f;
86 Assert.AreEqual(0.3f, testingTarget.Descender, "Should be equal!");
88 testingTarget.Dispose();
89 tlog.Debug(tag, $"FontMetricsDescender END (OK)");
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()
101 tlog.Debug(tag, $"FontMetricsHeight START");
103 var testingTarget = new FontMetrics();
104 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
105 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
107 testingTarget.Height = 0.3f;
108 Assert.AreEqual(0.3f, testingTarget.Height, "Should be equal!");
110 testingTarget.Dispose();
111 tlog.Debug(tag, $"FontMetricsHeight END (OK)");
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()
123 tlog.Debug(tag, $"FontMetricsUnderlinePosition START");
125 var testingTarget = new FontMetrics();
126 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
127 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
129 testingTarget.UnderlinePosition = 0.3f;
130 Assert.AreEqual(0.3f, testingTarget.UnderlinePosition, "Should be equal!");
132 testingTarget.Dispose();
133 tlog.Debug(tag, $"FontMetricsUnderlinePosition END (OK)");
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()
145 tlog.Debug(tag, $"FontMetricsUnderlineThickness START");
147 var testingTarget = new FontMetrics();
148 Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
149 Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
151 testingTarget.UnderlinePosition = 0.1f;
152 Assert.AreEqual(0.1f, testingTarget.UnderlinePosition, "Should be equal!");
154 testingTarget.Dispose();
155 tlog.Debug(tag, $"FontMetricsUnderlineThickness END (OK)");