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 tlog.Debug(tag, "InvalidKey : " + Property.InvalidKey);
50 tlog.Debug(tag, "InvalidComponentIndex : " + Property.InvalidComponentIndex);
52 using (Animatable ani = new Animatable())
54 testingTarget.Object = ani;
55 tlog.Debug(tag, "Object : " + testingTarget.Object);
58 testingTarget.Dispose();
60 tlog.Debug(tag, $"PropertyConstructor END (OK)");
65 [Description("Property constructor. With sub component index")]
66 [Property("SPEC", "Tizen.NUI.Property.Property C")]
67 [Property("SPEC_URL", "-")]
68 [Property("CRITERIA", "CONSTR")]
69 [Property("AUTHOR", "guowei.wang@samsung.com")]
70 public void PropertyConstructorWithSubComponentIndex()
72 tlog.Debug(tag, $"PropertyConstructorWithSubComponentIndex START");
74 var animatable = new Animatable();
75 Assert.IsNotNull(animatable, "Should be not null!");
76 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
78 var dummyIndex = 28000000;
79 var testingTarget = new Property(animatable, dummyIndex, -1);
80 Assert.IsNotNull(testingTarget, "Should be not null!");
81 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
83 testingTarget.Dispose();
85 tlog.Debug(tag, $"PropertyConstructorWithSubComponentIndex END (OK)");
90 [Description("Property constructor. With property name")]
91 [Property("SPEC", "Tizen.NUI.Property.Property C")]
92 [Property("SPEC_URL", "-")]
93 [Property("CRITERIA", "CONSTR")]
94 [Property("AUTHOR", "guowei.wang@samsung.com")]
95 public void PropertyConstructorWithPropertyName()
97 tlog.Debug(tag, $"PropertyConstructorWithPropertyName START");
99 var animatable = new Animatable();
100 Assert.IsNotNull(animatable, "Should be not null!");
101 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
103 var testingTarget = new Property(animatable, "image");
104 Assert.IsNotNull(testingTarget, "Should be not null!");
105 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
107 testingTarget.Dispose();
108 animatable.Dispose();
109 tlog.Debug(tag, $"PropertyConstructorWithPropertyName END (OK)");
114 [Description("Property constructor. With property name and sub component index")]
115 [Property("SPEC", "Tizen.NUI.Property.Property C")]
116 [Property("SPEC_URL", "-")]
117 [Property("CRITERIA", "CONSTR")]
118 [Property("AUTHOR", "guowei.wang@samsung.com")]
119 public void PropertyConstructorWithPropertyNameSubComponentIndex()
121 tlog.Debug(tag, $"PropertyConstructorWithPropertyNameSubComponentIndex START");
123 var animatable = new Animatable();
124 Assert.IsNotNull(animatable, "Should be not null!");
125 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
127 var testingTarget = new Property(animatable, "image", -1);
128 Assert.IsNotNull(testingTarget, "Should be not null!");
129 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
131 testingTarget.Dispose();
132 animatable.Dispose();
133 tlog.Debug(tag, $"PropertyConstructorWithPropertyNameSubComponentIndex END (OK)");
138 [Description("Property propertyIndex. Get")]
139 [Property("SPEC", "Tizen.NUI.Property.propertyIndex A")]
140 [Property("SPEC_URL", "-")]
141 [Property("CRITERIA", "PRO")]
142 [Property("AUTHOR", "guowei.wang@samsung.com")]
143 public void PropertyPropertyIndexGet()
145 tlog.Debug(tag, $"PropertyPropertyIndexGet START");
147 var animatable = new Animatable();
148 Assert.IsNotNull(animatable, "Should be not null!");
149 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
151 var testingTarget = new Property(animatable, 28000000);
152 Assert.IsNotNull(testingTarget, "Should be not null!");
153 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
155 var result = testingTarget.propertyIndex;
156 Assert.IsTrue(28000000 == result);
158 testingTarget.Dispose();
159 animatable.Dispose();
160 tlog.Debug(tag, $"PropertyPropertyIndexGet END (OK)");
165 [Description("Property propertyIndex. Set")]
166 [Property("SPEC", "Tizen.NUI.Property.propertyIndex A")]
167 [Property("SPEC_URL", "-")]
168 [Property("CRITERIA", "PRO")]
169 [Property("AUTHOR", "guowei.wang@samsung.com")]
170 public void PropertyPropertyIndexSet()
172 tlog.Debug(tag, $"PropertyPropertyIndexSet START");
174 var animatable = new Animatable();
175 Assert.IsNotNull(animatable, "Should be not null!");
176 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
178 var testingTarget = new Property(animatable, 28000000);
179 Assert.IsNotNull(testingTarget, "Should be not null!");
180 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
182 testingTarget.propertyIndex = 29000000;
183 var result = testingTarget.propertyIndex;
184 Assert.IsTrue(29000000 == result);
186 testingTarget.Dispose();
187 animatable.Dispose();
188 tlog.Debug(tag, $"PropertyPropertyIndexSet END (OK)");
193 [Description("Property componentIndex. Get")]
194 [Property("SPEC", "Tizen.NUI.Property.componentIndex A")]
195 [Property("SPEC_URL", "-")]
196 [Property("CRITERIA", "PRO")]
197 [Property("AUTHOR", "guowei.wang@samsung.com")]
198 public void PropertyComponentIndexGet()
200 tlog.Debug(tag, $"PropertyComponentIndexGet START");
202 var animatable = new Animatable();
203 Assert.IsNotNull(animatable, "Should be not null!");
204 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
206 var testingTarget = new Property(animatable, 28000000, -1);
207 Assert.IsNotNull(testingTarget, "Should be not null!");
208 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
210 var result = testingTarget.componentIndex;
211 Assert.IsTrue(-1 == result);
213 testingTarget.Dispose();
214 animatable.Dispose();
215 tlog.Debug(tag, $"PropertyComponentIndexGet END (OK)");
220 [Description("Property componentIndex. Get")]
221 [Property("SPEC", "Tizen.NUI.Property.componentIndex A")]
222 [Property("SPEC_URL", "-")]
223 [Property("CRITERIA", "PRO")]
224 [Property("AUTHOR", "guowei.wang@samsung.com")]
225 public void PropertyComponentIndexSet()
227 tlog.Debug(tag, $"PropertyComponentIndexSet START");
229 var animatable = new Animatable();
230 Assert.IsNotNull(animatable, "Should be not null!");
231 Assert.IsInstanceOf<Animatable>(animatable, "Should return PropertyValue instance.");
233 var testingTarget = new Property(animatable, 28000000, -1);
234 Assert.IsNotNull(testingTarget, "Should be not null!");
235 Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
237 testingTarget.componentIndex = 30000000;
238 var result = testingTarget.componentIndex;
239 Assert.IsTrue(30000000 == result);
241 testingTarget.Dispose();
242 animatable.Dispose();
243 tlog.Debug(tag, $"PropertyComponentIndexSet END (OK)");