[NUI] remove build warning messages
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / BaseComponents / TSTextMapHelper.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 Tizen.NUI.Text;
7 using System.Collections.Generic;
8
9 namespace Tizen.NUI.Devel.Tests
10 {
11     using tlog = Tizen.Log;
12
13     [TestFixture]
14     [Description("public/BaseComponents/TextMapHelper")]
15     class PublicTextMapHelperTest
16     {
17         private const string tag = "NUITEST";
18
19         [SetUp]
20         public void Init()
21         {
22             tlog.Info(tag, "Init() is called!");
23         }
24
25         [TearDown]
26         public void Destroy()
27         {
28             tlog.Info(tag, "Destroy() is called!");
29         }
30
31         [Test]
32         [Category("P1")]
33         [Description("TextMapHelper GetFontWidthString.")]
34         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontWidthString M")]
35         [Property("SPEC_URL", "-")]
36         [Property("CRITERIA", "MR")]
37         [Property("AUTHOR", "bowon.ryu@samsung.com")]
38         public void TextMapHelperGetFontWidthString()
39         {
40             tlog.Debug(tag, $"TextMapHelperGetFontWidthString START");
41
42             string fontWidthString;
43
44             fontWidthString = TextMapHelper.GetFontWidthString(FontWidthType.ExtraCondensed);
45             Assert.AreEqual("extraCondensed", fontWidthString, "Should be equal!");
46
47             tlog.Debug(tag, $"TextMapHelperGetFontWidthString END (OK)");
48         }
49
50         [Test]
51         [Category("P1")]
52         [Description("TextMapHelper GetFontWeightString.")]
53         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontWeightString M")]
54         [Property("SPEC_URL", "-")]
55         [Property("CRITERIA", "MR")]
56         [Property("AUTHOR", "bowon.ryu@samsung.com")]
57         public void TextMapHelperGetFontWeightString()
58         {
59             tlog.Debug(tag, $"TextMapHelperGetFontWeightString START");
60
61             string fontWeightString;
62
63             fontWeightString = TextMapHelper.GetFontWeightString(FontWeightType.Light);
64             Assert.AreEqual("light", fontWeightString, "Should be equal!");
65
66             tlog.Debug(tag, $"TextMapHelperGetFontWeightString END (OK)");
67         }
68
69         [Test]
70         [Category("P1")]
71         [Description("TextMapHelper GetFontSlantString.")]
72         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontSlantString M")]
73         [Property("SPEC_URL", "-")]
74         [Property("CRITERIA", "MR")]
75         [Property("AUTHOR", "bowon.ryu@samsung.com")]
76         public void TextMapHelperGetFontSlantString()
77         {
78             tlog.Debug(tag, $"TextMapHelperGetFontSlantString START");
79
80             string fontSlantString;
81
82             fontSlantString = TextMapHelper.GetFontSlantString(FontSlantType.Italic);
83             Assert.AreEqual("italic", fontSlantString, "Should be equal!");
84
85             tlog.Debug(tag, $"TextMapHelperGetFontSlantString END (OK)");
86         }
87
88         [Test]
89         [Category("P1")]
90         [Description("TextMapHelper GetFontWidthType.")]
91         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontWidthType M")]
92         [Property("SPEC_URL", "-")]
93         [Property("CRITERIA", "MR")]
94         [Property("AUTHOR", "bowon.ryu@samsung.com")]
95         public void TextMapHelperGetFontWidthType()
96         {
97             tlog.Debug(tag, $"TextMapHelperGetFontWidthType START");
98
99             FontWidthType fontWidthType;
100             
101             fontWidthType = TextMapHelper.GetFontWidthType("ExtraCondensed");
102             Assert.AreEqual(FontWidthType.ExtraCondensed, fontWidthType, "Should be equal!");
103
104             fontWidthType = TextMapHelper.GetFontWidthType("InvalidType");
105             Assert.AreEqual(FontWidthType.None, fontWidthType, "If invalid type, should be None type!");
106
107             tlog.Debug(tag, $"TextMapHelperGetFontWidthType END (OK)");
108         }
109
110         [Test]
111         [Category("P1")]
112         [Description("TextMapHelper GetFontWeightType.")]
113         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontWeightType M")]
114         [Property("SPEC_URL", "-")]
115         [Property("CRITERIA", "MR")]
116         [Property("AUTHOR", "bowon.ryu@samsung.com")]
117         public void TextMapHelperGetFontWeightType()
118         {
119             tlog.Debug(tag, $"TextMapHelperGetFontWeightType START");
120
121             FontWeightType fontWeightType;
122             
123             fontWeightType = TextMapHelper.GetFontWeightType("Light");
124             Assert.AreEqual(FontWeightType.Light, fontWeightType, "Should be equal!");
125
126             fontWeightType = TextMapHelper.GetFontWeightType("InvalidType");
127             Assert.AreEqual(FontWeightType.None, fontWeightType, "If invalid type, should be None type!");
128
129             tlog.Debug(tag, $"TextMapHelperGetFontWeightType END (OK)");
130         }
131
132         [Test]
133         [Category("P1")]
134         [Description("TextMapHelper GetFontSlantType.")]
135         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontSlantType M")]
136         [Property("SPEC_URL", "-")]
137         [Property("CRITERIA", "MR")]
138         [Property("AUTHOR", "bowon.ryu@samsung.com")]
139         public void TextMapHelperGetFontSlantType()
140         {
141             tlog.Debug(tag, $"TextMapHelperGetFontSlantType START");
142
143             FontSlantType fontSlantType;
144             
145             fontSlantType = TextMapHelper.GetFontSlantType("Italic");
146             Assert.AreEqual(FontSlantType.Italic, fontSlantType, "Should be equal!");
147
148             fontSlantType = TextMapHelper.GetFontSlantType("InvalidType");
149             Assert.AreEqual(FontSlantType.None, fontSlantType, "If invalid type, should be None type!");
150
151             tlog.Debug(tag, $"TextMapHelperGetFontSlantType END (OK)");
152         }
153
154         [Test]
155         [Category("P1")]
156         [Description("TextMapHelper GetFontStyleMap.")]
157         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontStyleMap M")]
158         [Property("SPEC_URL", "-")]
159         [Property("CRITERIA", "MR")]
160         [Property("AUTHOR", "bowon.ryu@samsung.com")]
161         public void TextMapHelperGetFontStyleMap()
162         {
163             tlog.Debug(tag, $"TextMapHelperGetFontStyleMap START");
164
165             var fontStyle = new Tizen.NUI.Text.FontStyle()
166             {
167                 Width = FontWidthType.Expanded,
168                 Weight = FontWeightType.Bold,
169                 Slant = FontSlantType.Italic
170             };
171
172             var map = TextMapHelper.GetFontStyleMap(fontStyle);
173             map["width"].Get(out string width);
174             map["weight"].Get(out string weight);
175             map["slant"].Get(out string slant);
176
177             Assert.AreEqual("expanded", width, "Should be equal!");
178             Assert.AreEqual("bold", weight, "Should be equal!");
179             Assert.AreEqual("italic", slant, "Should be equal!");
180
181             tlog.Debug(tag, $"TextMapHelperGetFontStyleMap END (OK)");
182         }
183
184         [Test]
185         [Category("P1")]
186         [Description("TextMapHelper GetFontStyleStruct.")]
187         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontStyleStruct M")]
188         [Property("SPEC_URL", "-")]
189         [Property("CRITERIA", "MR")]
190         [Property("AUTHOR", "bowon.ryu@samsung.com")]
191         public void TextMapHelperGetFontStyleStruct()
192         {
193             tlog.Debug(tag, $"TextMapHelperGetFontStyleStruct START");
194
195             var map = new PropertyMap();
196             map.Add("width", new PropertyValue("expanded"));
197             map.Add("weight", new PropertyValue("bold"));
198             map.Add("slant", new PropertyValue("italic"));
199
200             FontStyle fontStyle = TextMapHelper.GetFontStyleStruct(map);
201             Assert.AreEqual(FontWidthType.Expanded, fontStyle.Width, "Should be equal!");
202             Assert.AreEqual(FontWeightType.Bold, fontStyle.Weight, "Should be equal!");
203             Assert.AreEqual(FontSlantType.Italic, fontStyle.Slant, "Should be equal!");
204
205             tlog.Debug(tag, $"TextMapHelperGetFontStyleStruct END (OK)");
206         }
207
208         [Test]
209         [Category("P1")]
210         [Description("TextMapHelper GetInputFilterMap.")]
211         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetInputFilterMap M")]
212         [Property("SPEC_URL", "-")]
213         [Property("CRITERIA", "MR")]
214         [Property("AUTHOR", "bowon.ryu@samsung.com")]
215         public void TextMapHelperGetInputFilterMap()
216         {
217             tlog.Debug(tag, $"TextMapHelperGetInputFilterMap START");
218
219             var inputFilter = new Tizen.NUI.Text.InputFilter()
220             {
221                 Accepted = @"[\d]",
222                 Rejected = "[0-3]"
223             };
224
225             var map = TextMapHelper.GetInputFilterMap(inputFilter);
226             map.Find(0).Get(out string accepted);
227             map.Find(1).Get(out string rejected);
228
229             Assert.AreEqual(accepted, inputFilter.Accepted, "Should be equal!");
230             Assert.AreEqual(rejected, inputFilter.Rejected, "Should be equal!");
231
232             tlog.Debug(tag, $"TextMapHelperGetInputFilterMap END (OK)");
233         }
234
235         [Test]
236         [Category("P1")]
237         [Description("TextMapHelper GetInputFilterStruct.")]
238         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetInputFilterStruct M")]
239         [Property("SPEC_URL", "-")]
240         [Property("CRITERIA", "MR")]
241         [Property("AUTHOR", "bowon.ryu@samsung.com")]
242         public void TextMapHelperGGetInputFilterStruct()
243         {
244             tlog.Debug(tag, $"TextMapHelperGetInputFilterStruct START");
245
246             var map = new PropertyMap();
247             map.Add(0, new PropertyValue(@"[\d]"));
248             map.Add(1, new PropertyValue("[0-3]"));
249
250             var inputFilter = TextMapHelper.GetInputFilterStruct(map);
251             Assert.AreEqual(@"[\d]", inputFilter.Accepted, "Should be equal!");
252             Assert.AreEqual("[0-3]", inputFilter.Rejected, "Should be equal!");
253
254             tlog.Debug(tag, $"TextMapHelperGetInputFilterStruct END (OK)");
255         }
256
257         [Test]
258         [Category("P1")]
259         [Description("TextMapHelper GetUnderlineMap.")]
260         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetUnderlineMap M")]
261         [Property("SPEC_URL", "-")]
262         [Property("CRITERIA", "MR")]
263         [Property("AUTHOR", "bowon.ryu@samsung.com")]
264         public void TextMapHelperGetUnderlineMap()
265         {
266             tlog.Debug(tag, $"TextMapHelperGetUnderlineMap START");
267
268             var underline = new Tizen.NUI.Text.Underline()
269             {
270                 Enable = true,
271                 Color = new Color("#3498DB"),
272                 Height = 2.0f
273             };
274
275             var map = TextMapHelper.GetUnderlineMap(underline);
276             var color = new Color();
277             map.Find(0, "enable").Get(out bool enable);
278             map.Find(0, "color").Get(color);
279             map.Find(0, "height").Get(out float height);
280
281             Assert.AreEqual(enable, underline.Enable, "Should be equal!");
282             Assert.AreEqual(height, underline.Height, "Should be equal!");
283             Assert.AreEqual(color.R, underline.Color.R, "Should be equal!");
284             Assert.AreEqual(color.G, underline.Color.G, "Should be equal!");
285             Assert.AreEqual(color.B, underline.Color.B, "Should be equal!");
286             Assert.AreEqual(color.A, underline.Color.A, "Should be equal!");
287
288             tlog.Debug(tag, $"TextMapHelperGetUnderlineMap END (OK)");
289         }
290
291         [Test]
292         [Category("P1")]
293         [Description("TextMapHelper GetUnderlineStruct.")]
294         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetUnderlineStruct M")]
295         [Property("SPEC_URL", "-")]
296         [Property("CRITERIA", "MR")]
297         [Property("AUTHOR", "bowon.ryu@samsung.com")]
298         public void TextMapHelperGetUnderlineStruct()
299         {
300             tlog.Debug(tag, $"TextMapHelperGetUnderlineStruct START");
301
302             var map = new PropertyMap();
303             var color = new Color("#3498DB");
304             map.Add("enable", new PropertyValue(true));
305             map.Add("color", new PropertyValue(color));
306             map.Add("height", new PropertyValue((float)2.0f));
307
308             var underline = TextMapHelper.GetUnderlineStruct(map);
309
310             Assert.AreEqual(true, underline.Enable, "Should be equal!");
311             Assert.AreEqual(2.0f, underline.Height, "Should be equal!");
312             Assert.AreEqual(color.R, underline.Color.R, "Should be equal!");
313             Assert.AreEqual(color.G, underline.Color.G, "Should be equal!");
314             Assert.AreEqual(color.B, underline.Color.B, "Should be equal!");
315             Assert.AreEqual(color.A, underline.Color.A, "Should be equal!");
316
317             tlog.Debug(tag, $"TextMapHelperGetUnderlineStruct END (OK)");
318         }
319
320         [Test]
321         [Category("P1")]
322         [Description("TextMapHelper GetShadowMap.")]
323         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetShadowMap M")]
324         [Property("SPEC_URL", "-")]
325         [Property("CRITERIA", "MR")]
326         [Property("AUTHOR", "bowon.ryu@samsung.com")]
327         public void TextMapHelperGetShadowMap()
328         {
329             tlog.Debug(tag, $"TextMapHelperGetShadowMap START");
330
331             var shadow = new Tizen.NUI.Text.Shadow()
332             {
333                 Offset = new Vector2(3, 3),
334                 Color = new Color("#F1C40F"),
335                 BlurRadius = 2.0f,
336             };
337
338             var map = TextMapHelper.GetShadowMap(shadow);
339             var offset = new Vector2();
340             var color = new Color();
341             map.Find(0, "offset").Get(offset);
342             map.Find(0, "color").Get(color);
343             map.Find(0, "blurRadius").Get(out float blurRadius);
344
345             Assert.AreEqual(blurRadius, shadow.BlurRadius, "Should be equal!");
346             Assert.AreEqual(offset.X, shadow.Offset.X, "Should be equal!");
347             Assert.AreEqual(offset.Y, shadow.Offset.Y, "Should be equal!");
348             Assert.AreEqual(color.R, shadow.Color.R, "Should be equal!");
349             Assert.AreEqual(color.G, shadow.Color.G, "Should be equal!");
350             Assert.AreEqual(color.B, shadow.Color.B, "Should be equal!");
351             Assert.AreEqual(color.A, shadow.Color.A, "Should be equal!");
352
353             tlog.Debug(tag, $"TextMapHelperGetShadowMap END (OK)");
354         }
355
356         [Test]
357         [Category("P1")]
358         [Description("TextMapHelper GetShadowStruct.")]
359         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetShadowStruct M")]
360         [Property("SPEC_URL", "-")]
361         [Property("CRITERIA", "MR")]
362         [Property("AUTHOR", "bowon.ryu@samsung.com")]
363         public void TextMapHelperGetShadowStruct()
364         {
365             tlog.Debug(tag, $"TextMapHelperGetShadowStruct START");
366
367             var offset = new Vector2(5, 5);
368             var color = new Color("#F1C40F");
369             float blurRadius = 5.0f;
370
371             var map = new PropertyMap();
372             map.Add("offset", new PropertyValue(offset));
373             map.Add("color", new PropertyValue(color));
374             map.Add("blurRadius", new PropertyValue((float)blurRadius));
375
376             var shadow = TextMapHelper.GetShadowStruct(map);
377
378             Assert.AreEqual(blurRadius, shadow.BlurRadius, "Should be equal!");
379             Assert.AreEqual(offset.X, shadow.Offset.X, "Should be equal!");
380             Assert.AreEqual(offset.Y, shadow.Offset.Y, "Should be equal!");
381             Assert.AreEqual(color.R, shadow.Color.R, "Should be equal!");
382             Assert.AreEqual(color.G, shadow.Color.G, "Should be equal!");
383             Assert.AreEqual(color.B, shadow.Color.B, "Should be equal!");
384             Assert.AreEqual(color.A, shadow.Color.A, "Should be equal!");
385
386             tlog.Debug(tag, $"TextMapHelperGetShadowStruct END (OK)");
387         }
388
389         [Test]
390         [Category("P1")]
391         [Description("TextMapHelper GetOutlineMap.")]
392         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetOutlineMap M")]
393         [Property("SPEC_URL", "-")]
394         [Property("CRITERIA", "MR")]
395         [Property("AUTHOR", "guowei.wang@samsung.com")]
396         public void TextMapHelperGetOutlineMap()
397         {
398             tlog.Debug(tag, $"TextMapHelperGetOutlineMap START");
399
400             var outline = new Tizen.NUI.Text.Outline()
401             {
402                 Width = 2.0f,
403                 Color = new Color("#45B39D"),
404             };
405
406             var map = TextMapHelper.GetOutlineMap(outline);
407             var color = new Color();
408             map.Find(0, "color").Get(color);
409             map.Find(0, "width").Get(out float width);
410
411             Assert.AreEqual(width, outline.Width, "Should be equal!");
412             Assert.AreEqual(color.R, outline.Color.R, "Should be equal!");
413             Assert.AreEqual(color.G, outline.Color.G, "Should be equal!");
414             Assert.AreEqual(color.B, outline.Color.B, "Should be equal!");
415             Assert.AreEqual(color.A, outline.Color.A, "Should be equal!");
416
417             tlog.Debug(tag, $"TextMapHelperGetOutlineMap END (OK)");
418         }
419
420         [Test]
421         [Category("P1")]
422         [Description("TextMapHelper GetOutlineStruct.")]
423         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetOutlineStruct M")]
424         [Property("SPEC_URL", "-")]
425         [Property("CRITERIA", "MR")]
426         [Property("AUTHOR", "guowei.wang@samsung.com")]
427         public void TextMapHelperGetOutlineStruct()
428         {
429             tlog.Debug(tag, $"TextMapHelperGetOutlineStruct START");
430
431             var width = 2.0f;
432             var color = new Color("#45B39D");
433
434             var map = new PropertyMap();
435             map.Add("color", new PropertyValue(color));
436             map.Add("width", new PropertyValue((float)width));
437
438             var outline = TextMapHelper.GetOutlineStruct(map);
439             Assert.AreEqual(width, outline.Width, "Should be equal!");
440             Assert.AreEqual(color.R, outline.Color.R, "Should be equal!");
441             Assert.AreEqual(color.G, outline.Color.G, "Should be equal!");
442             Assert.AreEqual(color.B, outline.Color.B, "Should be equal!");
443             Assert.AreEqual(color.A, outline.Color.A, "Should be equal!");
444
445             tlog.Debug(tag, $"TextMapHelperGetOutlineStruct END (OK)");
446         }
447
448         [Test]
449         [Category("P1")]
450         [Description("TextMapHelper GetFontSizeString.")]
451         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontSizeString M")]
452         [Property("SPEC_URL", "-")]
453         [Property("CRITERIA", "MR")]
454         [Property("AUTHOR", "bowon.ryu@samsung.com")]
455         public void TextMapHelperGetFontSizeString()
456         {
457             tlog.Debug(tag, $"TextMapHelperGetFontSizeString START");
458
459             string fontSizeTypeString = TextMapHelper.GetFontSizeString(FontSizeType.PointSize);
460             Assert.AreEqual("pointSize", fontSizeTypeString, "Should be equal!");
461
462             fontSizeTypeString = TextMapHelper.GetFontSizeString(FontSizeType.PixelSize);
463             Assert.AreEqual("pixelSize", fontSizeTypeString, "Should be equal!");
464
465             tlog.Debug(tag, $"TextMapHelperGetFontSizeString END (OK)");
466         }
467
468         [Test]
469         [Category("P1")]
470         [Description("TextMapHelper GetFontSizeType.")]
471         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFontSizeType M")]
472         [Property("SPEC_URL", "-")]
473         [Property("CRITERIA", "MR")]
474         [Property("AUTHOR", "bowon.ryu@samsung.com")]
475         public void TextMapHelperGetFontSizeType()
476         {
477             tlog.Debug(tag, $"TextMapHelperGetFontSizeType START");
478  
479             FontSizeType fontSizeType;
480
481             fontSizeType = TextMapHelper.GetFontSizeType("PointSize");
482             Assert.AreEqual(FontSizeType.PointSize, fontSizeType, "Should be equal!");
483
484             fontSizeType = TextMapHelper.GetFontSizeType("PixelSize");
485             Assert.AreEqual(FontSizeType.PixelSize, fontSizeType, "Should be equal!");
486
487             fontSizeType = TextMapHelper.GetFontSizeType("InvalidType");
488             Assert.AreEqual(FontSizeType.PointSize, fontSizeType, "If invalid type, should be PointSize type!");
489       
490             tlog.Debug(tag, $"TextMapHelperGetFontSizeType END (OK)");
491         }
492
493         [Test]
494         [Category("P1")]
495         [Description("TextMapHelper GetTextFitMap.")]
496         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetTextFitMap M")]
497         [Property("SPEC_URL", "-")]
498         [Property("CRITERIA", "MR")]
499         [Property("AUTHOR", "bowon.ryu@samsung.com")]
500         public void TextMapHelperGetTextFitMap()
501         {
502             tlog.Debug(tag, $"TextMapHelperGetTextFitMap START");
503
504             var textFit = new Tizen.NUI.Text.TextFit()
505             {
506                 Enable = true,
507                 MinSize = 10.0f,
508                 MaxSize = 100.0f,
509                 StepSize = 5.0f,
510                 FontSizeType = FontSizeType.PointSize
511             };
512
513             var map = TextMapHelper.GetTextFitMap(textFit);
514             map.Find(0, "enable").Get(out bool enable);
515             map.Find(0, "minSize").Get(out float minSize);
516             map.Find(0, "maxSize").Get(out float maxSize);
517             map.Find(0, "stepSize").Get(out float stepSize);
518             map.Find(0, "fontSizeType").Get(out string fontSizeType);
519
520             Assert.AreEqual(enable, textFit.Enable, "Should be equal!");
521             Assert.AreEqual(minSize, textFit.MinSize, "Should be equal!");
522             Assert.AreEqual(maxSize, textFit.MaxSize, "Should be equal!");
523             Assert.AreEqual(stepSize, textFit.StepSize, "Should be equal!");
524             Assert.AreEqual(fontSizeType, "pointSize", "Should be equal!");
525
526             tlog.Debug(tag, $"TextMapHelperGetTextFitMap END (OK)");
527         }
528
529         [Test]
530         [Category("P1")]
531         [Description("TextMapHelper GetTextFitStruct.")]
532         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetTextFitStruct M")]
533         [Property("SPEC_URL", "-")]
534         [Property("CRITERIA", "MR")]
535         [Property("AUTHOR", "bowon.ryu@samsung.com")]
536         public void TextMapHelperGetTextFitStruct()
537         {
538             tlog.Debug(tag, $"TextMapHelperGetTextFitStruct START");
539
540             bool enable = true;
541             float minSize = 10.0f;
542             float maxSize = 100.0f;
543             float stepSize = 5.0f;
544
545             var map = new PropertyMap();
546             map.Add("enable", new PropertyValue(enable));
547             map.Add("minSize", new PropertyValue((float)minSize));
548             map.Add("maxSize", new PropertyValue((float)maxSize));
549             map.Add("stepSize", new PropertyValue((float)stepSize));
550             map.Add("fontSizeType", new PropertyValue("pointSize"));
551
552             var textFit = TextMapHelper.GetTextFitStruct(map);
553
554             Assert.AreEqual(enable, textFit.Enable, "Should be equal!");
555             Assert.AreEqual(minSize, textFit.MinSize, "Should be equal!");
556             Assert.AreEqual(maxSize, textFit.MaxSize, "Should be equal!");
557             Assert.AreEqual(stepSize, textFit.StepSize, "Should be equal!");
558             Assert.AreEqual(FontSizeType.PointSize, textFit.FontSizeType, "Should be equal!");
559
560             tlog.Debug(tag, $"TextMapHelperGetTextFitStruct END (OK)");
561         }
562
563         [Test]
564         [Category("P1")]
565         [Description("TextMapHelper GetPlaceholderMap.")]
566         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetPlaceholderMap M")]
567         [Property("SPEC_URL", "-")]
568         [Property("CRITERIA", "MR")]
569         [Property("AUTHOR", "bowon.ryu@samsung.com")]
570         public void TextMapHelperGetPlaceholderMap()
571         {
572             tlog.Debug(tag, $"TextMapHelperGetPlaceholderMap START");
573
574             var placeholder = new Tizen.NUI.Text.Placeholder()
575             {
576                 Text = "placeholder text",
577                 TextFocused = "placeholder textFocused",
578                 Color = new Color("#45B39D"),
579                 FontFamily = "BreezeSans",
580                 FontStyle = new Tizen.NUI.Text.FontStyle()
581                 {
582                     Width = FontWidthType.Expanded,
583                     Weight = FontWeightType.Bold,
584                     Slant = FontSlantType.Italic,
585                 },
586                 PointSize = 25.0f,
587                 Ellipsis = true
588             };
589
590             string text = "";
591             string textFocused = "";
592             Color color = new Color();
593             string fontFamily = null;
594             var fontStyle = new PropertyMap();
595             float pointSize;
596             bool ellipsis = false;
597
598             var map = TextMapHelper.GetPlaceholderMap(placeholder);
599             map.Find(0).Get(out text);
600             map.Find(1).Get(out textFocused);
601             map.Find(2).Get(color);
602             map.Find(3).Get(out fontFamily);
603             map.Find(4).Get(fontStyle);
604             map.Find(5).Get(out pointSize);
605             map.Find(7).Get(out ellipsis);
606
607             fontStyle["width"].Get(out string width);
608             fontStyle["weight"].Get(out string weight);
609             fontStyle["slant"].Get(out string slant);
610
611             Assert.AreEqual(text, placeholder.Text, "Should be equal!");
612             Assert.AreEqual(textFocused, placeholder.TextFocused, "Should be equal!");
613             Assert.AreEqual(color.R, placeholder.Color.R, "Should be equal!");
614             Assert.AreEqual(color.G, placeholder.Color.G, "Should be equal!");
615             Assert.AreEqual(color.B, placeholder.Color.B, "Should be equal!");
616             Assert.AreEqual(color.A, placeholder.Color.A, "Should be equal!");
617             Assert.AreEqual(fontFamily, placeholder.FontFamily, "Should be equal!");
618             Assert.AreEqual(width, "expanded", "Should be equal!");
619             Assert.AreEqual(weight, "bold", "Should be equal!");
620             Assert.AreEqual(slant, "italic", "Should be equal!");
621             Assert.AreEqual(pointSize, placeholder.PointSize, "Should be equal!");
622             Assert.AreEqual(ellipsis, placeholder.Ellipsis, "Should be equal!");
623
624             tlog.Debug(tag, $"TextMapHelperGetPlaceholderMap END (OK)");
625         }
626
627         [Test]
628         [Category("P1")]
629         [Description("TextMapHelper GetPlaceholderStruct.")]
630         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetPlaceholderStruct M")]
631         [Property("SPEC_URL", "-")]
632         [Property("CRITERIA", "MR")]
633         [Property("AUTHOR", "bowon.ryu@samsung.com")]
634         public void TextMapHelperGetPlaceholderStruct()
635         {
636             tlog.Debug(tag, $"TextMapHelperGetPlaceholderStruct START");
637
638             string text = "placeholder text";
639             string textFocused = "placeholder textFocused";
640             Color color = new Color("#45B39D");
641             string fontFamily = "BreezeSans";
642             var fontStyle = new PropertyMap();
643             fontStyle.Add("width", new PropertyValue("expanded"));
644             fontStyle.Add("weight", new PropertyValue("bold"));
645             fontStyle.Add("slant", new PropertyValue("italic"));
646             float pointSize = 25.0f;
647             bool ellipsis = false;
648
649             var map = new PropertyMap();
650             map.Add(0, new PropertyValue(text));
651             map.Add(1, new PropertyValue(textFocused));
652             map.Add(2, new PropertyValue(color));
653             map.Add(3, new PropertyValue(fontFamily));
654             map.Add(4, new PropertyValue(fontStyle));
655             map.Add(5, new PropertyValue((float)pointSize));
656             map.Add(7, new PropertyValue(ellipsis));
657
658             var placeholder = TextMapHelper.GetPlaceholderStruct(map);
659
660             Assert.AreEqual(text, placeholder.Text, "Should be equal!");
661             Assert.AreEqual(textFocused, placeholder.TextFocused, "Should be equal!");
662             Assert.AreEqual(color.R, placeholder.Color.R, "Should be equal!");
663             Assert.AreEqual(color.G, placeholder.Color.G, "Should be equal!");
664             Assert.AreEqual(color.B, placeholder.Color.B, "Should be equal!");
665             Assert.AreEqual(color.A, placeholder.Color.A, "Should be equal!");
666             Assert.AreEqual(fontFamily, placeholder.FontFamily, "Should be equal!");
667             Assert.AreEqual(FontWidthType.Expanded, placeholder.FontStyle?.Width, "Should be equal!");
668             Assert.AreEqual(FontWeightType.Bold, placeholder.FontStyle?.Weight, "Should be equal!");
669             Assert.AreEqual(FontSlantType.Italic, placeholder.FontStyle?.Slant, "Should be equal!");
670             Assert.AreEqual(pointSize, placeholder.PointSize, "Should be equal!");
671             Assert.AreEqual(ellipsis, false, "Should be equal!");
672
673             tlog.Debug(tag, $"TextMapHelperGetPlaceholderStruct END (OK)");
674         }
675
676         [Test]
677         [Category("P1")]
678         [Description("TextMapHelper GetHiddenInputMap.")]
679         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetHiddenInputMap M")]
680         [Property("SPEC_URL", "-")]
681         [Property("CRITERIA", "MR")]
682         [Property("AUTHOR", "bowon.ryu@samsung.com")]
683         public void TextMapHelperGetHiddenInputMap()
684         {
685             tlog.Debug(tag, $"TextMapHelperGetHiddenInputMap START");
686
687             var hiddenInput = new Tizen.NUI.Text.HiddenInput()
688             {
689                 Mode = HiddenInputModeType.ShowLastCharacter,
690                 SubstituteCharacter = '★',
691                 SubstituteCount = 0,
692                 ShowLastCharacterDuration = 1000
693             };
694
695             var map = TextMapHelper.GetHiddenInputMap(hiddenInput);
696
697             map.Find(0).Get(out int mode);
698             map.Find(1).Get(out int substituteCharacter);
699             map.Find(2).Get(out int substituteCount);
700             map.Find(3).Get(out int showLastCharacterDuration);
701
702             Assert.AreEqual(mode, (int)hiddenInput.Mode, "Should be equal!");
703             Assert.AreEqual(substituteCharacter, Convert.ToInt32(hiddenInput.SubstituteCharacter), "Should be equal!");
704             Assert.AreEqual(substituteCount, hiddenInput.SubstituteCount, "Should be equal!");
705             Assert.AreEqual(showLastCharacterDuration, hiddenInput.ShowLastCharacterDuration, "Should be equal!");
706
707             tlog.Debug(tag, $"TextMapHelperGetHiddenInputMap END (OK)");
708         }
709
710         [Test]
711         [Category("P1")]
712         [Description("TextMapHelper GetHiddenInputStruct.")]
713         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetHiddenInputStruct M")]
714         [Property("SPEC_URL", "-")]
715         [Property("CRITERIA", "MR")]
716         [Property("AUTHOR", "bowon.ryu@samsung.com")]
717         public void TextMapHelperGetHiddenInputStruct()
718         {
719             tlog.Debug(tag, $"TextMapHelperGetHiddenInputStruct START");
720
721             int mode = (int)HiddenInputModeType.ShowLastCharacter;
722             int substituteCharacter = Convert.ToInt32('★');
723             int substituteCount = 0;
724             int showLastCharacterDuration = 1000;
725
726             var map = new PropertyMap();
727             map.Add(0, new PropertyValue(mode));
728             map.Add(1, new PropertyValue(substituteCharacter));
729             map.Add(2, new PropertyValue(substituteCount));
730             map.Add(3, new PropertyValue(showLastCharacterDuration));
731
732             var hiddenInput = TextMapHelper.GetHiddenInputStruct(map);
733
734             Assert.AreEqual(mode, (int)hiddenInput.Mode, "Should be equal!");
735             Assert.AreEqual(substituteCharacter, Convert.ToInt32(hiddenInput.SubstituteCharacter), "Should be equal!");
736             Assert.AreEqual(substituteCount, hiddenInput.SubstituteCount, "Should be equal!");
737             Assert.AreEqual(showLastCharacterDuration, hiddenInput.ShowLastCharacterDuration, "Should be equal!");
738
739             tlog.Debug(tag, $"TextMapHelperGetHiddenInputStruct END (OK)");
740         }
741
742         [Test]
743         [Category("P1")]
744         [Description("TextMapHelper GetFileNameMap.")]
745         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFileNameMap M")]
746         [Property("SPEC_URL", "-")]
747         [Property("CRITERIA", "MR")]
748         [Property("AUTHOR", "bowon.ryu@samsung.com")]
749         public void TextMapHelperGetFileNameMap()
750         {
751             tlog.Debug(tag, $"TextMapHelperGetFileNameMap START");
752
753             string url = "filePath";
754
755             var map = TextMapHelper.GetFileNameMap(url);
756             map.Find(0, "filename").Get(out string fileName);
757
758             Assert.AreEqual(url, fileName, "Should be equal!");
759
760             tlog.Debug(tag, $"TextMapHelperGetFileNameMap END (OK)");
761         }
762
763         [Test]
764         [Category("P1")]
765         [Description("TextMapHelper GetSelectionHandleImageStruct.")]
766         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetSelectionHandleImageStruct M")]
767         [Property("SPEC_URL", "-")]
768         [Property("CRITERIA", "MR")]
769         [Property("AUTHOR", "bowon.ryu@samsung.com")]
770         public void TextMapHelperGetSelectionHandleImageStruct()
771         {
772             tlog.Debug(tag, $"TextMapHelperGetSelectionHandleImageStruct START");
773
774             string leftImageUrl = "leftImageUrl";
775             string rightImageUrl = "rightImageUrl";
776
777             var leftImageMap = new PropertyMap().Add("filename", new PropertyValue(leftImageUrl));
778             var rightImageMap = new PropertyMap().Add("filename", new PropertyValue(rightImageUrl));
779
780             var selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap);
781
782             Assert.AreEqual(leftImageUrl, selectionHandleImage.LeftImageUrl, "Should be equal!");
783             Assert.AreEqual(rightImageUrl, selectionHandleImage.RightImageUrl, "Should be equal!");
784
785             tlog.Debug(tag, $"TextMapHelperGetSelectionHandleImageStruct END (OK)");
786         }
787
788         [Test]
789         [Category("P1")]
790         [Description("TextMapHelper GetCamelCase.")]
791         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetCamelCase M")]
792         [Property("SPEC_URL", "-")]
793         [Property("CRITERIA", "MR")]
794         [Property("AUTHOR", "bowon.ryu@samsung.com")]
795         public void TextMapHelperGetCamelCase()
796         {
797             tlog.Debug(tag, $"TextMapHelperGetCamelCase START");
798
799             string pascalCase = "TextMapHelper";
800             string camelCase = "textMapHelper";
801             string expectedResult = TextMapHelper.GetCamelCase(pascalCase);
802
803             Assert.AreEqual(camelCase, expectedResult, "Should be equal!");
804
805             string emptyString = "";
806             expectedResult = TextMapHelper.GetCamelCase(emptyString);            
807
808             Assert.AreEqual(emptyString, expectedResult, "Should be equal!");
809
810             tlog.Debug(tag, $"TextMapHelperGetCamelCase END (OK)");
811         }
812
813         [Test]
814         [Category("P1")]
815         [Description("TextMapHelper GetStringFromMap.")]
816         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetStringFromMap M")]
817         [Property("SPEC_URL", "-")]
818         [Property("CRITERIA", "MR")]
819         [Property("AUTHOR", "bowon.ryu@samsung.com")]
820         public void TextMapHelperGetStringFromMap()
821         {
822             tlog.Debug(tag, $"TextMapHelperGetStringFromMap START");
823
824             var stringKey = "width";
825             var stringInvalidKey = "invalidKey";
826             var intKey = 1;
827             var intInvalidKey = 10;
828             var value = "expanded";
829             var defaultValue = "none";
830
831             var map = new PropertyMap();
832             map.Add(stringKey, new PropertyValue(value));
833             map.Add(intKey, new PropertyValue(value));
834
835             var result = TextMapHelper.GetStringFromMap(map, stringKey, defaultValue);
836             Assert.AreEqual(value, result, "Should be equal!");
837
838             result = TextMapHelper.GetStringFromMap(map, stringInvalidKey, defaultValue);
839             Assert.AreEqual(defaultValue, result, "Should be equal!");
840
841             result = TextMapHelper.GetStringFromMap(map, intKey, defaultValue);
842             Assert.AreEqual(value, result, "Should be equal!");
843
844             result = TextMapHelper.GetStringFromMap(map, intInvalidKey, defaultValue);
845             Assert.AreEqual(defaultValue, result, "Should be equal!");
846
847             tlog.Debug(tag, $"TextMapHelperGetStringFromMap END (OK)");
848         }
849
850         [Test]
851         [Category("P1")]
852         [Description("TextMapHelper GetBoolFromMap.")]
853         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetBoolFromMap M")]
854         [Property("SPEC_URL", "-")]
855         [Property("CRITERIA", "MR")]
856         [Property("AUTHOR", "bowon.ryu@samsung.com")]
857         public void TextMapHelperGetBoolFromMap()
858         {
859             tlog.Debug(tag, $"TextMapHelperGetBoolFromMap START");
860
861             var stringKey = "width";
862             var stringInvalidKey = "invalidKey";
863             var intKey = 1;
864             var intInvalidKey = 10;
865             var value = true;
866             var defaultValue = false;
867
868             var map = new PropertyMap();
869             map.Add(stringKey, new PropertyValue(value));
870             map.Add(intKey, new PropertyValue(value));
871
872             var result = TextMapHelper.GetBoolFromMap(map, stringKey, defaultValue);
873             Assert.AreEqual(value, result, "Should be equal!");
874
875             result = TextMapHelper.GetBoolFromMap(map, stringInvalidKey, defaultValue);
876             Assert.AreEqual(defaultValue, result, "Should be equal!");
877
878             result = TextMapHelper.GetBoolFromMap(map, intKey, defaultValue);
879             Assert.AreEqual(value, result, "Should be equal!");
880
881             result = TextMapHelper.GetBoolFromMap(map, intInvalidKey, defaultValue);
882             Assert.AreEqual(defaultValue, result, "Should be equal!");
883
884             tlog.Debug(tag, $"TextMapHelperGetBoolFromMap END (OK)");
885         }
886
887         [Test]
888         [Category("P1")]
889         [Description("TextMapHelper GetIntFromMap.")]
890         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetIntFromMap M")]
891         [Property("SPEC_URL", "-")]
892         [Property("CRITERIA", "MR")]
893         [Property("AUTHOR", "bowon.ryu@samsung.com")]
894         public void TextMapHelperGetIntFromMap()
895         {
896             tlog.Debug(tag, $"TextMapHelperGetIntFromMap START");
897
898             var intKey = 1;
899             var intInvalidKey = 10;
900             var value = 3080;
901             var defaultValue = 0;
902
903             var map = new PropertyMap();
904             map.Add(intKey, new PropertyValue(value));
905
906             var result = TextMapHelper.GetIntFromMap(map, intKey, defaultValue);
907             Assert.AreEqual(value, result, "Should be equal!");
908
909             result = TextMapHelper.GetIntFromMap(map, intInvalidKey, defaultValue);
910             Assert.AreEqual(defaultValue, result, "Should be equal!");
911
912             tlog.Debug(tag, $"TextMapHelperGetIntFromMap END (OK)");
913         }
914
915         [Test]
916         [Category("P1")]
917         [Description("TextMapHelper GetFloatFromMap.")]
918         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetFloatFromMap M")]
919         [Property("SPEC_URL", "-")]
920         [Property("CRITERIA", "MR")]
921         [Property("AUTHOR", "bowon.ryu@samsung.com")]
922         public void TextMapHelperGetFloatFromMap()
923         {
924             tlog.Debug(tag, $"TextMapHelperGetFloatFromMap START");
925
926             var stringKey = "width";
927             var stringInvalidKey = "invalidKey";
928             float value = 3.14f;
929             float defaultValue = 0.0f;
930
931             var map = new PropertyMap();
932             map.Add(stringKey, new PropertyValue(value));
933
934             var result = TextMapHelper.GetFloatFromMap(map, stringKey, defaultValue);
935             Assert.AreEqual(value, result, "Should be equal!");
936
937             result = TextMapHelper.GetFloatFromMap(map, stringInvalidKey, defaultValue);
938             Assert.AreEqual(defaultValue, result, "Should be equal!");
939
940             tlog.Debug(tag, $"TextMapHelperGetFloatFromMap END (OK)");
941         }
942
943         [Test]
944         [Category("P1")]
945         [Description("TextMapHelper GetColorFromMap.")]
946         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetColorFromMap M")]
947         [Property("SPEC_URL", "-")]
948         [Property("CRITERIA", "MR")]
949         [Property("AUTHOR", "bowon.ryu@samsung.com")]
950         public void TextMapHelperGetColorFromMap()
951         {
952             tlog.Debug(tag, $"TextMapHelperGetColorFromMap START");
953
954             var stringKey = "color";
955             var stringInvalidKey = "invalidKey";
956             var intKey = 1;
957             var value = new Color(1.0f, 0.2f, 0.5f, 1.0f);
958
959             var map = new PropertyMap();
960             map.Add(stringKey, new PropertyValue(value));
961             map.Add(intKey, new PropertyValue(value));
962
963             var result = TextMapHelper.GetColorFromMap(map, stringKey);
964             Assert.AreEqual(value.R, result.R, "Should be equal!");
965             Assert.AreEqual(value.G, result.G, "Should be equal!");
966             Assert.AreEqual(value.B, result.B, "Should be equal!");
967             Assert.AreEqual(value.A, result.A, "Should be equal!");
968
969             result = TextMapHelper.GetColorFromMap(map, intKey);
970             Assert.AreEqual(value.R, result.R, "Should be equal!");
971             Assert.AreEqual(value.G, result.G, "Should be equal!");
972             Assert.AreEqual(value.B, result.B, "Should be equal!");
973             Assert.AreEqual(value.A, result.A, "Should be equal!");
974
975             tlog.Debug(tag, $"TextMapHelperGetColorFromMap END (OK)");
976         }
977
978         [Test]
979         [Category("P1")]
980         [Description("TextMapHelper GetVector2FromMap.")]
981         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetVector2FromMap M")]
982         [Property("SPEC_URL", "-")]
983         [Property("CRITERIA", "MR")]
984         [Property("AUTHOR", "bowon.ryu@samsung.com")]
985         public void TextMapHelperGetVector2FromMap()
986         {
987             tlog.Debug(tag, $"TextMapHelperGetVector2FromMap START");
988
989             var stringKey = "position";
990             var stringInvalidKey = "invalidKey";
991             var value = new Vector2(3, 10);
992
993             var map = new PropertyMap();
994             map.Add(stringKey, new PropertyValue(value));
995
996             var result = TextMapHelper.GetVector2FromMap(map, stringKey);
997             Assert.AreEqual(value.X, result.X, "Should be equal!");
998             Assert.AreEqual(value.Y, result.Y, "Should be equal!");
999
1000             tlog.Debug(tag, $"TextMapHelperGetVector2FromMap END (OK)");
1001         }
1002
1003         [Test]
1004         [Category("P1")]
1005         [Description("TextMapHelper GetMapFromMap.")]
1006         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetMapFromMap M")]
1007         [Property("SPEC_URL", "-")]
1008         [Property("CRITERIA", "MR")]
1009         [Property("AUTHOR", "bowon.ryu@samsung.com")]
1010         public void TextMapHelperGetMapFromMap()
1011         {
1012             tlog.Debug(tag, $"TextMapHelperGetMapFromMap START");
1013
1014             var intKey = 1;
1015             var value = new PropertyMap();
1016             value.Add("width", new PropertyValue(10));
1017             value.Add("height", new PropertyValue(20));
1018
1019             var map = new PropertyMap();
1020             map.Add(intKey, new PropertyValue(value));
1021
1022             var result = TextMapHelper.GetMapFromMap(map, intKey);
1023             result.Find(0, "width").Get(out int width);
1024             result.Find(0, "height").Get(out int height);
1025             Assert.AreEqual(10, width, "Should be equal!");
1026             Assert.AreEqual(20, height, "Should be equal!");
1027
1028             tlog.Debug(tag, $"TextMapHelperGetMapFromMap END (OK)");
1029         }
1030
1031         [Test]
1032         [Category("P1")]
1033         [Description("TextMapHelper GetNullableIntFromMap.")]
1034         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetNullableIntFromMap M")]
1035         [Property("SPEC_URL", "-")]
1036         [Property("CRITERIA", "MR")]
1037         [Property("AUTHOR", "bowon.ryu@samsung.com")]
1038         public void TextMapHelperGetNullableIntFromMap()
1039         {
1040             tlog.Debug(tag, $"TextMapHelperGetNullableIntFromMap START");
1041
1042             var intKey = 1;
1043             var intInvalidKey = 10;
1044             int value = 3080;
1045             int? result = null;
1046
1047             var map = new PropertyMap();
1048             map.Add(intKey, new PropertyValue(value));
1049
1050             result = TextMapHelper.GetNullableIntFromMap(map, intKey);
1051             Assert.AreEqual(value, result, "Should be equal!");
1052
1053             result = TextMapHelper.GetNullableIntFromMap(map, intInvalidKey);
1054             Assert.AreEqual(null, result, "Should be equal!");
1055
1056             tlog.Debug(tag, $"TextMapHelperGetNullableIntFromMap END (OK)");
1057         }
1058
1059         [Test]
1060         [Category("P1")]
1061         [Description("TextMapHelper GetNullableFloatFromMap.")]
1062         [Property("SPEC", "Tizen.NUI.TextMapHelper.GetNullableFloatFromMap M")]
1063         [Property("SPEC_URL", "-")]
1064         [Property("CRITERIA", "MR")]
1065         [Property("AUTHOR", "bowon.ryu@samsung.com")]
1066         public void TextMapHelperGetNullableFloatFromMap()
1067         {
1068             tlog.Debug(tag, $"TextMapHelperGetNullableFloatFromMap START");
1069
1070             var intKey = 1;
1071             var intInvalidKey = 10;
1072             float value = 3.14f;
1073             float? result = null;
1074
1075             var map = new PropertyMap();
1076             map.Add(intKey, new PropertyValue(value));
1077
1078             result = TextMapHelper.GetNullableFloatFromMap(map, intKey);
1079             Assert.AreEqual(value, result, "Should be equal!");
1080
1081             result = TextMapHelper.GetNullableFloatFromMap(map, intInvalidKey);
1082             Assert.AreEqual(null, result, "Should be equal!");
1083
1084             tlog.Debug(tag, $"TextMapHelperGetNullableFloatFromMap END (OK)");
1085         }
1086
1087         [Test]
1088         [Category("P1")]
1089         [Description("TextMapHelper IsValue.")]
1090         [Property("SPEC", "Tizen.NUI.TextMapHelper.IsValue M")]
1091         [Property("SPEC_URL", "-")]
1092         [Property("CRITERIA", "MR")]
1093         [Property("AUTHOR", "bowon.ryu@samsung.com")]
1094         public void TextMapHelperIsValue()
1095         {
1096             tlog.Debug(tag, $"TextMapHelperIsValue START");
1097
1098             var intKey = 1;
1099             var intInvalidKey = 10;
1100             var value = "value";
1101             
1102             var map = new PropertyMap();
1103             map.Add(intKey, new PropertyValue(value));
1104
1105             var result = TextMapHelper.IsValue(map, intKey);
1106             Assert.AreEqual(true, result, "Should be true!");
1107
1108             result = TextMapHelper.IsValue(map, intInvalidKey);
1109             Assert.AreEqual(false, result, "Should be false!");
1110
1111             tlog.Debug(tag, $"TextMapHelperIsValue END (OK)");
1112         }
1113     }
1114 }