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("public/Common/Property")]
13 class PublicPropertyTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Property constructor")]
32 [Property("SPEC", "Tizen.NUI.Property.Property C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void PropertyConstructor()
38 tlog.Debug(tag, $"PropertyConstructor START");
40 var animatable = new Animatable();
41 Assert.IsNotNull(animatable, "Should be not null!");
42 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
44 var dummyIndex = 28000000;
45 var testingTarget = new Property(animatable, dummyIndex);
46 Assert.IsNotNull(testingTarget, "Should be not null!");
47 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
49 testingTarget.Dispose();
51 tlog.Debug(tag, $"PropertyConstructor END (OK)");
56 [Description("Property constructor. With sub component index")]
57 [Property("SPEC", "Tizen.NUI.Property.Property C")]
58 [Property("SPEC_URL", "-")]
59 [Property("CRITERIA", "CONSTR")]
60 [Property("AUTHOR", "guowei.wang@samsung.com")]
61 public void PropertyConstructorWithSubComponentIndex()
63 tlog.Debug(tag, $"PropertyConstructorWithSubComponentIndex START");
65 var animatable = new Animatable();
66 Assert.IsNotNull(animatable, "Should be not null!");
67 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
69 var dummyIndex = 28000000;
70 var testingTarget = new Property(animatable, dummyIndex, -1);
71 Assert.IsNotNull(testingTarget, "Should be not null!");
72 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
74 testingTarget.Dispose();
76 tlog.Debug(tag, $"PropertyConstructorWithSubComponentIndex END (OK)");
81 [Description("Property constructor. With property name")]
82 [Property("SPEC", "Tizen.NUI.Property.Property C")]
83 [Property("SPEC_URL", "-")]
84 [Property("CRITERIA", "CONSTR")]
85 [Property("AUTHOR", "guowei.wang@samsung.com")]
86 public void PropertyConstructorWithPropertyName()
88 tlog.Debug(tag, $"PropertyConstructorWithPropertyName START");
90 var animatable = new Animatable();
91 Assert.IsNotNull(animatable, "Should be not null!");
92 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
94 var testingTarget = new Property(animatable, "image");
95 Assert.IsNotNull(testingTarget, "Should be not null!");
96 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
98 testingTarget.Dispose();
100 tlog.Debug(tag, $"PropertyConstructorWithPropertyName END (OK)");
105 [Description("Property constructor. With property name and sub component index")]
106 [Property("SPEC", "Tizen.NUI.Property.Property C")]
107 [Property("SPEC_URL", "-")]
108 [Property("CRITERIA", "CONSTR")]
109 [Property("AUTHOR", "guowei.wang@samsung.com")]
110 public void PropertyConstructorWithPropertyNameSubComponentIndex()
112 tlog.Debug(tag, $"PropertyConstructorWithPropertyNameSubComponentIndex START");
114 var animatable = new Animatable();
115 Assert.IsNotNull(animatable, "Should be not null!");
116 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
118 var testingTarget = new Property(animatable, "image", -1);
119 Assert.IsNotNull(testingTarget, "Should be not null!");
120 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
122 testingTarget.Dispose();
123 animatable.Dispose();
124 tlog.Debug(tag, $"PropertyConstructorWithPropertyNameSubComponentIndex END (OK)");
129 [Description("Property propertyIndex. Get")]
130 [Property("SPEC", "Tizen.NUI.Property.propertyIndex A")]
131 [Property("SPEC_URL", "-")]
132 [Property("CRITERIA", "PRO")]
133 [Property("AUTHOR", "guowei.wang@samsung.com")]
134 public void PropertyPropertyIndexGet()
136 tlog.Debug(tag, $"PropertyPropertyIndexGet START");
138 var animatable = new Animatable();
139 Assert.IsNotNull(animatable, "Should be not null!");
140 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
142 var testingTarget = new Property(animatable, 28000000);
143 Assert.IsNotNull(testingTarget, "Should be not null!");
144 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
146 var result = testingTarget.propertyIndex;
147 Assert.IsTrue(28000000 == result);
149 testingTarget.Dispose();
150 animatable.Dispose();
151 tlog.Debug(tag, $"PropertyPropertyIndexGet END (OK)");
156 [Description("Property propertyIndex. Set")]
157 [Property("SPEC", "Tizen.NUI.Property.propertyIndex A")]
158 [Property("SPEC_URL", "-")]
159 [Property("CRITERIA", "PRO")]
160 [Property("AUTHOR", "guowei.wang@samsung.com")]
161 public void PropertyPropertyIndexSet()
163 tlog.Debug(tag, $"PropertyPropertyIndexSet START");
165 var animatable = new Animatable();
166 Assert.IsNotNull(animatable, "Should be not null!");
167 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
169 var testingTarget = new Property(animatable, 28000000);
170 Assert.IsNotNull(testingTarget, "Should be not null!");
171 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
173 testingTarget.propertyIndex = 29000000;
174 var result = testingTarget.propertyIndex;
175 Assert.IsTrue(29000000 == result);
177 testingTarget.Dispose();
178 animatable.Dispose();
179 tlog.Debug(tag, $"PropertyPropertyIndexSet END (OK)");
184 [Description("Property componentIndex. Get")]
185 [Property("SPEC", "Tizen.NUI.Property.componentIndex A")]
186 [Property("SPEC_URL", "-")]
187 [Property("CRITERIA", "PRO")]
188 [Property("AUTHOR", "guowei.wang@samsung.com")]
189 public void PropertyComponentIndexGet()
191 tlog.Debug(tag, $"PropertyComponentIndexGet START");
193 var animatable = new Animatable();
194 Assert.IsNotNull(animatable, "Should be not null!");
195 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
197 var testingTarget = new Property(animatable, 28000000, -1);
198 Assert.IsNotNull(testingTarget, "Should be not null!");
199 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
201 var result = testingTarget.componentIndex;
202 Assert.IsTrue(-1 == result);
204 testingTarget.Dispose();
205 animatable.Dispose();
206 tlog.Debug(tag, $"PropertyComponentIndexGet END (OK)");
211 [Description("Property componentIndex. Get")]
212 [Property("SPEC", "Tizen.NUI.Property.componentIndex A")]
213 [Property("SPEC_URL", "-")]
214 [Property("CRITERIA", "PRO")]
215 [Property("AUTHOR", "guowei.wang@samsung.com")]
216 public void PropertyComponentIndexSet()
218 tlog.Debug(tag, $"PropertyComponentIndexSet START");
220 var animatable = new Animatable();
221 Assert.IsNotNull(animatable, "Should be not null!");
222 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
224 var testingTarget = new Property(animatable, 28000000, -1);
225 Assert.IsNotNull(testingTarget, "Should be not null!");
226 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
228 testingTarget.componentIndex = 30000000;
229 var result = testingTarget.componentIndex;
230 Assert.IsTrue(30000000 == result);
232 testingTarget.Dispose();
233 animatable.Dispose();
234 tlog.Debug(tag, $"PropertyComponentIndexSet END (OK)");