[NUI] Make PrimaryCursorPosition property public
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / BaseComponents / TSTextConstants.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 using System.Collections.Generic;
7
8 namespace Tizen.NUI.Devel.Tests
9 {
10     using tlog = Tizen.Log;
11
12     [TestFixture]
13     [Description("public/BaseComponents/TextConstants")]
14     public class PublicTextConstantsTest
15     {
16         private const string tag = "NUITEST";
17
18         [SetUp]
19         public void Init()
20         {
21             tlog.Info(tag, "Init() is called!");
22         }
23
24         [TearDown]
25         public void Destroy()
26         {
27             tlog.Info(tag, "Destroy() is called!");
28         }
29
30         [Test]
31         [Category("P1")]
32         [Description("InputFilter Equals")]
33         [Property("SPEC", "Tizen.NUI.Text.InputFilter.Equals M")]
34         [Property("SPEC_URL", "-")]
35         [Property("CRITERIA", "MR")]
36         [Property("AUTHOR", "bowon.ryu@samsung.com")]
37         public void InputFilterEquals()
38         {
39             tlog.Debug(tag, $"InputFilterEquals START");
40
41             var inputFilter = new Tizen.NUI.Text.InputFilter();
42             Assert.IsNotNull(inputFilter, "Can't create success object inputFilter");
43             Assert.IsInstanceOf<Tizen.NUI.Text.InputFilter>(inputFilter, "Should be an instance of inputFilter type.");
44
45             var compare = new Tizen.NUI.Text.InputFilter();
46             Assert.IsTrue(inputFilter == compare, "Should be true!");
47             Assert.AreEqual(inputFilter.GetHashCode(), compare.GetHashCode(), "Should be true!");
48
49             compare.Accepted = @"[\d]";
50             Assert.IsTrue(inputFilter != compare, "Should be true!");
51
52             tlog.Debug(tag, $"InputFilterEquals END (OK)");
53         }
54
55         [Test]
56         [Category("P1")]
57         [Description("Strikethrough Equals")]
58         [Property("SPEC", "Tizen.NUI.Text.Strikethrough.Equals M")]
59         [Property("SPEC_URL", "-")]
60         [Property("CRITERIA", "MR")]
61         [Property("AUTHOR", "bowon.ryu@samsung.com")]
62         public void StrikethroughEquals()
63         {
64             tlog.Debug(tag, $"StrikethroughEquals START");
65
66             var strikethrough = new Tizen.NUI.Text.Strikethrough();
67             Assert.IsNotNull(strikethrough, "Can't create success object strikethrough");
68             Assert.IsInstanceOf<Tizen.NUI.Text.Strikethrough>(strikethrough, "Should be an instance of strikethrough type.");
69
70             var compare = new Tizen.NUI.Text.Strikethrough();
71             Assert.IsTrue(strikethrough == compare, "Should be true!");
72             Assert.AreEqual(strikethrough.GetHashCode(), compare.GetHashCode(), "Should be true!");
73
74             compare.Height = 2.0f;
75             Assert.IsTrue(strikethrough != compare, "Should be true!");
76
77             tlog.Debug(tag, $"StrikethroughEquals END (OK)");
78         }
79
80         [Test]
81         [Category("P1")]
82         [Description("FontStyle Equals")]
83         [Property("SPEC", "Tizen.NUI.Text.FontStyle.Equals M")]
84         [Property("SPEC_URL", "-")]
85         [Property("CRITERIA", "MR")]
86         [Property("AUTHOR", "bowon.ryu@samsung.com")]
87         public void FontStyleEquals()
88         {
89             tlog.Debug(tag, $"FontStyleEquals START");
90
91             var fontStyle = new Tizen.NUI.Text.FontStyle();
92             Assert.IsNotNull(fontStyle, "Can't create success object strikethrough");
93             Assert.IsInstanceOf<Tizen.NUI.Text.FontStyle>(fontStyle, "Should be an instance of fontStyle type.");
94
95             var compare = new Tizen.NUI.Text.FontStyle();
96             Assert.IsTrue(fontStyle == compare, "Should be true!");
97             Assert.AreEqual(fontStyle.GetHashCode(), compare.GetHashCode(), "Should be true!");
98
99             compare.Slant = FontSlantType.Italic;
100             Assert.IsTrue(fontStyle != compare, "Should be true!");
101
102             tlog.Debug(tag, $"FontStyleEquals END (OK)");
103         }
104
105         [Test]
106         [Category("P1")]
107         [Description("Underline Equals")]
108         [Property("SPEC", "Tizen.NUI.Text.Underline.Equals M")]
109         [Property("SPEC_URL", "-")]
110         [Property("CRITERIA", "MR")]
111         [Property("AUTHOR", "bowon.ryu@samsung.com")]
112         public void UnderlineEquals()
113         {
114             tlog.Debug(tag, $"UnderlineEquals START");
115
116             var underline = new Tizen.NUI.Text.Underline();
117             Assert.IsNotNull(underline, "Can't create success object strikethrough");
118             Assert.IsInstanceOf<Tizen.NUI.Text.Underline>(underline, "Should be an instance of underline type.");
119
120             var compare = new Tizen.NUI.Text.Underline();
121             Assert.IsTrue(underline == compare, "Should be true!");
122             Assert.AreEqual(underline.GetHashCode(), compare.GetHashCode(), "Should be true!");
123
124             compare.Color = Color.Red;
125             Assert.IsTrue(underline != compare, "Should be true!");
126
127             tlog.Debug(tag, $"UnderlineEquals END (OK)");
128         }
129
130         [Test]
131         [Category("P1")]
132         [Description("Shadow Equals")]
133         [Property("SPEC", "Tizen.NUI.Text.Shadow.Equals M")]
134         [Property("SPEC_URL", "-")]
135         [Property("CRITERIA", "MR")]
136         [Property("AUTHOR", "bowon.ryu@samsung.com")]
137         public void ShadowEquals()
138         {
139             tlog.Debug(tag, $"ShadowEquals START");
140
141             var shadow = new Tizen.NUI.Text.Shadow();
142             Assert.IsNotNull(shadow, "Can't create success object strikethrough");
143             Assert.IsInstanceOf<Tizen.NUI.Text.Shadow>(shadow, "Should be an instance of shadow type.");
144
145             var compare = new Tizen.NUI.Text.Shadow();
146             Assert.IsTrue(shadow == compare, "Should be true!");
147             Assert.AreEqual(shadow.GetHashCode(), compare.GetHashCode(), "Should be true!");
148
149             compare.BlurRadius = 5.0f;
150             Assert.IsTrue(shadow != compare, "Should be true!");
151
152             tlog.Debug(tag, $"ShadowEquals END (OK)");
153         }
154
155         [Test]
156         [Category("P1")]
157         [Description("Outline Equals")]
158         [Property("SPEC", "Tizen.NUI.Text.Outline.Equals M")]
159         [Property("SPEC_URL", "-")]
160         [Property("CRITERIA", "MR")]
161         [Property("AUTHOR", "bowon.ryu@samsung.com")]
162         public void OutlineEquals()
163         {
164             tlog.Debug(tag, $"OutlineEquals START");
165
166             var outline = new Tizen.NUI.Text.Outline();
167             Assert.IsNotNull(outline, "Can't create success object strikethrough");
168             Assert.IsInstanceOf<Tizen.NUI.Text.Outline>(outline, "Should be an instance of outline type.");
169
170             var compare = new Tizen.NUI.Text.Outline();
171             Assert.IsTrue(outline == compare, "Should be true!");
172             Assert.AreEqual(outline.GetHashCode(), compare.GetHashCode(), "Should be true!");
173
174             compare.Width = 2.0f;
175             Assert.IsTrue(outline != compare, "Should be true!");
176
177             tlog.Debug(tag, $"OutlineEquals END (OK)");
178         }
179
180         [Test]
181         [Category("P1")]
182         [Description("TextFit Equals")]
183         [Property("SPEC", "Tizen.NUI.Text.TextFit.Equals M")]
184         [Property("SPEC_URL", "-")]
185         [Property("CRITERIA", "MR")]
186         [Property("AUTHOR", "bowon.ryu@samsung.com")]
187         public void TextFitEquals()
188         {
189             tlog.Debug(tag, $"TextFitEquals START");
190
191             var textFit = new Tizen.NUI.Text.TextFit();
192             Assert.IsNotNull(textFit, "Can't create success object strikethrough");
193             Assert.IsInstanceOf<Tizen.NUI.Text.TextFit>(textFit, "Should be an instance of textFit type.");
194
195             var compare = new Tizen.NUI.Text.TextFit();
196             Assert.IsTrue(textFit == compare, "Should be true!");
197             Assert.AreEqual(textFit.GetHashCode(), compare.GetHashCode(), "Should be true!");
198
199             compare.StepSize = 10.0f;
200             Assert.IsTrue(textFit != compare, "Should be true!");
201
202             tlog.Debug(tag, $"TextFitEquals END (OK)");
203         }
204
205         [Test]
206         [Category("P1")]
207         [Description("Placeholder Equals")]
208         [Property("SPEC", "Tizen.NUI.Text.Placeholder.Equals M")]
209         [Property("SPEC_URL", "-")]
210         [Property("CRITERIA", "MR")]
211         [Property("AUTHOR", "bowon.ryu@samsung.com")]
212         public void PlaceholderEquals()
213         {
214             tlog.Debug(tag, $"PlaceholderEquals START");
215
216             var placeholder = new Tizen.NUI.Text.Placeholder();
217             Assert.IsNotNull(placeholder, "Can't create success object strikethrough");
218             Assert.IsInstanceOf<Tizen.NUI.Text.Placeholder>(placeholder, "Should be an instance of placeholder type.");
219
220             var compare = new Tizen.NUI.Text.Placeholder();
221             Assert.IsTrue(placeholder == compare, "Should be true!");
222             Assert.AreEqual(placeholder.GetHashCode(), compare.GetHashCode(), "Should be true!");
223
224             compare.Ellipsis = true;
225              Assert.IsTrue(placeholder != compare, "Should be true!");
226
227             tlog.Debug(tag, $"PlaceholderEquals END (OK)");
228         }
229
230         [Test]
231         [Category("P1")]
232         [Description("HiddenInput Equals")]
233         [Property("SPEC", "Tizen.NUI.Text.HiddenInput.Equals M")]
234         [Property("SPEC_URL", "-")]
235         [Property("CRITERIA", "MR")]
236         [Property("AUTHOR", "bowon.ryu@samsung.com")]
237         public void HiddenInputEquals()
238         {
239             tlog.Debug(tag, $"HiddenInputEquals START");
240
241             var hiddenInput = new Tizen.NUI.Text.HiddenInput();
242             Assert.IsNotNull(hiddenInput, "Can't create success object strikethrough");
243             Assert.IsInstanceOf<Tizen.NUI.Text.HiddenInput>(hiddenInput, "Should be an instance of hiddenInput type.");
244
245             var compare = new Tizen.NUI.Text.HiddenInput();
246             Assert.IsTrue(hiddenInput == compare, "Should be true!");
247             Assert.AreEqual(hiddenInput.GetHashCode(), compare.GetHashCode(), "Should be true!");
248
249             compare.ShowLastCharacterDuration = 10000;
250             Assert.IsTrue(hiddenInput != compare, "Should be true!");
251
252             tlog.Debug(tag, $"HiddenInputEquals END (OK)");
253         }
254
255         [Test]
256         [Category("P1")]
257         [Description("SelectionHandleImage Equals")]
258         [Property("SPEC", "Tizen.NUI.Text.SelectionHandleImage.Equals M")]
259         [Property("SPEC_URL", "-")]
260         [Property("CRITERIA", "MR")]
261         [Property("AUTHOR", "bowon.ryu@samsung.com")]
262         public void SelectionHandleImageEquals()
263         {
264             tlog.Debug(tag, $"SelectionHandleImageEquals START");
265
266             var selectionHandleImage = new Tizen.NUI.Text.SelectionHandleImage();
267             Assert.IsNotNull(selectionHandleImage, "Can't create success object strikethrough");
268             Assert.IsInstanceOf<Tizen.NUI.Text.SelectionHandleImage>(selectionHandleImage, "Should be an instance of selectionHandleImage type.");
269
270             var compare = new Tizen.NUI.Text.SelectionHandleImage();
271             Assert.IsTrue(selectionHandleImage == compare, "Should be true!");
272             Assert.AreEqual(selectionHandleImage.GetHashCode(), compare.GetHashCode(), "Should be true!");
273
274             compare.LeftImageUrl = "left image url";
275             Assert.IsTrue(selectionHandleImage != compare, "Should be true!");
276
277             tlog.Debug(tag, $"SelectionHandleImageEquals END (OK)");
278         }
279     }
280 }