3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
7 using System.Threading.Tasks;
8 using Tizen.NUI.Utility;
10 namespace Tizen.NUI.Devel.Tests
12 using tlog = Tizen.Log;
15 [Description("public/Utility/TextPageUtil")]
16 class PublicTextPageUtilTest
18 private const string tag = "NUITEST";
23 tlog.Info(tag, "Init() is called!");
29 tlog.Info(tag, "Destroy() is called!");
34 [Description("TextPageUtil SetText.")]
35 [Property("SPEC", "Tizen.NUI.TextPageUtil.SetText M")]
36 [Property("SPEC_URL", "-")]
37 [Property("CRITERIA", "MR")]
38 [Property("AUTHOR", "guowei.wang@samsung.com")]
39 public void TextPageUtilSetText()
41 tlog.Debug(tag, $"TextPageUtilSetText START");
43 TextPageUtil testingTarget = new TextPageUtil();
44 Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil");
45 Assert.IsInstanceOf<TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type.");
47 using (TextLabel label = new TextLabel())
49 label.EnableMarkup = true;
50 label.Text = "PublicPageUtilTest";
51 var result = testingTarget.SetText(label, "My PageUtil");
52 Assert.IsNotNull(result);
55 // label.EnableMarkup = false
56 using (TextLabel label = new TextLabel())
58 label.EnableMarkup = false;
59 label.Text = "PublicPageUtilTest";
60 var result = testingTarget.SetText(label, "MyPageUtil");
61 Assert.IsNotNull(result);
64 testingTarget.Dispose();
65 tlog.Debug(tag, $"TextPageUtilSetText END (OK)");
70 [Description("TextPageUtil GetText.")]
71 [Property("SPEC", "Tizen.NUI.TextPageUtil.GetText M")]
72 [Property("SPEC_URL", "-")]
73 [Property("CRITERIA", "MR")]
74 [Property("AUTHOR", "guowei.wang@samsung.com")]
75 public void TextPageUtilGetText()
77 tlog.Debug(tag, $"TextPageUtilGetText START");
79 TextPageUtil testingTarget = new TextPageUtil();
80 Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil");
81 Assert.IsInstanceOf<TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type.");
83 using (TextLabel label = new TextLabel())
85 label.EnableMarkup = true;
86 label.Text = "PublicPageUtilTest";
87 var result = testingTarget.SetText(label, "MyPageUtil");
88 Assert.IsNotNull(result);
90 /** if param is 0 will return */
93 testingTarget.GetText(0);
97 tlog.Debug(tag, e.Message.ToString());
98 Assert.Fail("Caught Exception: Failed!");
103 testingTarget.GetText(1);
107 tlog.Debug(tag, e.Message.ToString());
108 Assert.Fail("Caught Exception: Failed!");
112 testingTarget.Dispose();
113 tlog.Debug(tag, $"TextPageUtilGetText END (OK)");
118 [Description("TextPageUtil GetText situation.")]
119 [Property("SPEC", "Tizen.NUI.TextPageUtil.GetText situation M")]
120 [Property("SPEC_URL", "-")]
121 [Property("CRITERIA", "MR")]
122 [Property("AUTHOR", "guowei.wang@samsung.com")]
123 public void TextPageUtilGetTextsituation()
125 tlog.Debug(tag, $"TextPageUtilGetTextsituation START");
127 TextPageUtil testingTarget = new TextPageUtil();
128 Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil");
129 Assert.IsInstanceOf<TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type.");
131 using (TextLabel label = new TextLabel())
133 label.EnableMarkup = true;
134 label.Text = "PublicPageUtilTest";
136 var result = testingTarget.SetText(label, "MyPageUtil");
137 Assert.IsNotNull(result);
139 /** if param is 0 will return */
142 testingTarget.GetText(-1);
146 tlog.Debug(tag, e.Message.ToString());
147 Assert.Fail("Caught Exception: Failed!");
151 testingTarget.Dispose();
152 tlog.Debug(tag, $"TextPageUtilGetTextsituation END (OK)");
157 [Description("TextPageUtil PageData.")]
158 [Property("SPEC", "Tizen.NUI.TextPageUtil.PageData A")]
159 [Property("SPEC_URL", "-")]
160 [Property("CRITERIA", "PRW")]
161 [Property("AUTHOR", "guowei.wang@samsung.com")]
162 public void TextPageUtilPageData()
164 tlog.Debug(tag, $"TextPageUtilPageData START");
166 var testingTarget = new PageData();
168 testingTarget.PreviousTag = "previous";
169 tlog.Debug(tag, "PreviousTag : " + testingTarget.PreviousTag);
171 testingTarget.EndTag = "end";
172 tlog.Debug(tag, "EndTag : " + testingTarget.EndTag);
174 testingTarget.StartOffset = 0;
175 tlog.Debug(tag, "StartOffset : " + testingTarget.StartOffset);
177 testingTarget.EndOffset = 2;
178 tlog.Debug(tag, "EndOffset : " + testingTarget.EndOffset);
180 tlog.Debug(tag, $"TextPageUtilPageData END (OK)");
185 [Description("TextPageUtil TagData.")]
186 [Property("SPEC", "Tizen.NUI.TextPageUtil.TagData A")]
187 [Property("SPEC_URL", "-")]
188 [Property("CRITERIA", "PRW")]
189 [Property("AUTHOR", "guowei.wang@samsung.com")]
190 public void TextPageUtilTagData()
192 tlog.Debug(tag, $"TextPageUtilTagData START");
194 var testingTarget = new TagData();
196 testingTarget.TagName = "tag";
197 tlog.Debug(tag, "TagName : " + testingTarget.TagName);
199 testingTarget.AttributeName = "size";
200 tlog.Debug(tag, "AttributName : " + testingTarget.AttributeName);
202 testingTarget.IsEndTag = true;
203 tlog.Debug(tag, "IsEndTag" + testingTarget.IsEndTag);
205 tlog.Debug(tag, $"TextPageUtilTagData END (OK)");