[NUI] make Tizen.NUI.Devel.Tests be built in csharp-tct by copying the folder itself
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / ViewProperty / TSTextShadow.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 using System.Threading.Tasks;
8
9 namespace Tizen.NUI.Devel.Tests
10 {
11     using tlog = Tizen.Log;
12
13     [TestFixture]
14     [Description("public/ViewProperty/TextShadow.cs")]
15     public class PublicTextShadowTest
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("TextShadow constructor.")]
34         [Property("SPEC", "Tizen.NUI.TextShadow.TextShadow C")]
35         [Property("SPEC_URL", "-")]
36         [Property("CRITERIA", "CONSTR")]
37         [Property("AUTHOR", "guowei.wang@samsung.com")]
38         public void TextShadowConstructor()
39         {
40             tlog.Debug(tag, $"TextShadowConstructor START");
41
42             using (Vector2 vector = new Vector2(1.5f, 3.0f))
43             {
44                 var testingTarget = new TextShadow(Color.Cyan, vector, 0.3f);
45                 Assert.IsNotNull(testingTarget, "Can't create success object TextShadow");
46                 Assert.IsInstanceOf<TextShadow>(testingTarget, "Should be an instance of TextShadow type.");
47
48                 testingTarget.Dispose();
49             }
50
51             tlog.Debug(tag, $"TextShadowConstructor END (OK)");
52         }
53
54         [Test]
55         [Category("P1")]
56         [Description("TextShadow constructor. With TextShadow.")]
57         [Property("SPEC", "Tizen.NUI.TextShadow.TextShadow C")]
58         [Property("SPEC_URL", "-")]
59         [Property("CRITERIA", "CONSTR")]
60         [Property("AUTHOR", "guowei.wang@samsung.com")]
61         public void TextShadowConstructorWithTextShadow()
62         {
63             tlog.Debug(tag, $"TextShadowConstructorWithTextShadow START");
64
65             using (Vector2 vector = new Vector2(1.5f, 3.0f))
66             {
67                 using (TextShadow shadow = new TextShadow(Color.Cyan, vector, 0.3f))
68                 {
69                     try
70                     {
71                         var testingTarget =  new TextShadow(shadow);
72                         testingTarget.Dispose();
73                     }
74                     catch (Exception e)
75                     {
76                         tlog.Debug(tag, e.Message.ToString());
77                         Assert.Fail("Caught Exception: Failed!");
78                     }
79                     
80                 }
81             }
82
83             tlog.Debug(tag, $"TextShadowConstructorWithTextShadow END (OK)");
84         }
85
86         [Test]
87         [Category("P1")]
88         [Description("TextShadow constructor. With PropertyMap.")]
89         [Property("SPEC", "Tizen.NUI.TextShadow.TextShadow C")]
90         [Property("SPEC_URL", "-")]
91         [Property("CRITERIA", "CONSTR")]
92         [Property("AUTHOR", "guowei.wang@samsung.com")]
93         public void TextShadowConstructorWithPropertyMap()
94         {
95             tlog.Debug(tag, $"TextShadowConstructorWithPropertyMap START");
96
97             TextLabel textLabel = new TextLabel()
98             {
99                 Text = "TextShadowConstructor",
100                 Color = Color.Green,
101                 PointSize = 15.0f,
102             };
103             PropertyMap temp = new PropertyMap();
104             Tizen.NUI.Object.GetProperty((global::System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.SHADOW).Get(temp);
105
106             var testingTarget = new TextShadow(temp);
107             Assert.IsNotNull(testingTarget, "Can't create success object TextShadow");
108             Assert.IsInstanceOf<TextShadow>(testingTarget, "Should be an instance of TextShadow type.");
109
110             textLabel.Dispose();
111             testingTarget.Dispose();
112             tlog.Debug(tag, $"TextShadowConstructorWithPropertyMap END (OK)");
113         }
114
115         [Test]
116         [Category("P1")]
117         [Description("TextShadow Clone.")]
118         [Property("SPEC", "Tizen.NUI.TextShadow.Clone M")]
119         [Property("SPEC_URL", "-")]
120         [Property("CRITERIA", "MR")]
121         [Property("AUTHOR", "guowei.wang@samsung.com")]
122         public void TextShadowClone()
123         {
124             tlog.Debug(tag, $"TextShadowClone START");
125
126             using (Vector2 vector = new Vector2(1.5f, 3.0f))
127             {
128                 using (TextShadow textShadow = new TextShadow(Color.Cyan, vector, 0.3f))
129                 {
130                     try
131                     {
132                         textShadow.Clone();
133                     }
134                     catch (Exception e)
135                     {
136                         tlog.Debug(tag, e.Message.ToString());
137                         Assert.Fail("Caught Exception: Failed!");
138                     }
139                 }
140             }
141
142             tlog.Debug(tag, $"TextShadowClone END (OK)");
143         }
144
145         [Test]
146         [Category("P1")]
147         [Description("TextShadow Clone. With TextShadow.")]
148         [Property("SPEC", "Tizen.NUI.TextShadow.Clone M")]
149         [Property("SPEC_URL", "-")]
150         [Property("CRITERIA", "MR")]
151         [Property("AUTHOR", "guowei.wang@samsung.com")]
152         public void TextShadowCloneWithTextShadow()
153         {
154             tlog.Debug(tag, $"TextShadowCloneWithTextShadow START");
155
156             TextLabel textLabel = new TextLabel()
157             {
158                 Text = "TextShadowConstructor",
159                 Color = Color.Green,
160                 PointSize = 15.0f,
161             };
162             PropertyMap temp = new PropertyMap();
163             Tizen.NUI.Object.GetProperty((global::System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.SHADOW).Get(temp);
164
165             try
166             {
167                 TextShadow.Clone(new TextShadow(temp));
168             }
169             catch (Exception e)
170             {
171                 tlog.Debug(tag, e.Message.ToString());
172                 Assert.Fail("Caught Exception: Failed!");
173             }
174
175             textLabel.Dispose();
176             tlog.Debug(tag, $"TextShadowCloneWithTextShadow END (OK)");
177         }
178
179         [Test]
180         [Category("P1")]
181         [Description("TextShadow Clone. With null TextShadow.")]
182         [Property("SPEC", "Tizen.NUI.TextShadow.Clone M")]
183         [Property("SPEC_URL", "-")]
184         [Property("CRITERIA", "MR")]
185         [Property("AUTHOR", "guowei.wang@samsung.com")]
186         public void TextShadowCloneWithNullTextShadow()
187         {
188             tlog.Debug(tag, $"TextShadowCloneWithNullTextShadow START");
189
190             TextShadow textShadow = null;
191             var testingTarget = TextShadow.Clone(textShadow);
192             Assert.IsNull(testingTarget);     
193
194             tlog.Debug(tag, $"TextShadowCloneWithNullTextShadow END (OK)");
195         }
196
197         [Test]
198         [Category("P1")]
199         [Description("TextShadow ToPropertyValue.")]
200         [Property("SPEC", "Tizen.NUI.TextShadow.ToPropertyValue M")]
201         [Property("SPEC_URL", "-")]
202         [Property("CRITERIA", "MR")]
203         [Property("AUTHOR", "guowei.wang@samsung.com")]
204         public void TextShadowToPropertyValue()
205         {
206             tlog.Debug(tag, $"TextShadowToPropertyValue START");
207
208             TextLabel textLabel = new TextLabel()
209             {
210                 Text = "TextShadowConstructor",
211                 Color = Color.Green,
212                 PointSize = 15.0f,
213             };
214             PropertyMap temp = new PropertyMap();
215             Tizen.NUI.Object.GetProperty((global::System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.SHADOW).Get(temp);
216
217             using (TextShadow textShadow = new TextShadow(temp))
218             {
219
220                 var testingTarget = TextShadow.ToPropertyValue(textShadow);
221                 Assert.IsNotNull(testingTarget, "Can't create success object PropertyValue");
222                 Assert.IsInstanceOf<PropertyValue>(testingTarget, "Should be an instance of PropertyValue type.");
223
224                 testingTarget.Dispose();
225             }
226
227             textLabel.Dispose();
228             tlog.Debug(tag, $"TextShadowToPropertyValue END (OK)");
229         }
230
231         [Test]
232         [Category("P2")]
233         [Description("TextShadow ToPropertyValue. Instance is null.")]
234         [Property("SPEC", "Tizen.NUI.TextShadow.ToPropertyValue M")]
235         [Property("SPEC_URL", "-")]
236         [Property("CRITERIA", "MR")]
237         [Property("AUTHOR", "guowei.wang@samsung.com")]
238         public void TextShadowToPropertyValueWithNullInstance()
239         {
240             tlog.Debug(tag, $"TextShadowToPropertyValueWithNullInstance START");
241
242             var testingTarget = TextShadow.ToPropertyValue(null);
243             Assert.IsNotNull(testingTarget, "Can't create success object PropertyValue");
244             Assert.IsInstanceOf<PropertyValue>(testingTarget, "Should be an instance of PropertyValue type.");
245
246             testingTarget.Dispose();
247             tlog.Debug(tag, $"TextShadowToPropertyValueWithNullInstance END (OK)");
248         }
249     }
250 }