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("internal/Common/Any")]
13 public class InternalAnyTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Any constructor.")]
32 [Property("SPEC", "Tizen.NUI.Any.Any C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void AnyConstructor()
38 tlog.Debug(tag, $"AnyConstructor START");
40 var testingTarget = new Any();
41 Assert.IsNotNull(testingTarget, "Can't create success object Any");
42 Assert.IsInstanceOf<Any>(testingTarget, "Should be an instance of Any type.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"AnyConstructor END (OK)");
50 [Description("Any constructor. With Any.")]
51 [Property("SPEC", "Tizen.NUI.Any.Any C")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "CONSTR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void AnyConstructorWithAny()
57 tlog.Debug(tag, $"AnyConstructorWithAny START");
59 using (Any any = new Any())
61 var testingTarget = new Any(any);
62 Assert.IsNotNull(testingTarget, "Can't create success object Any");
63 Assert.IsInstanceOf<Any>(testingTarget, "Should be an instance of Any type.");
65 testingTarget.Dispose();
68 tlog.Debug(tag, $"AnyConstructorWithAny END (OK)");
73 [Description("Any Assign.")]
74 [Property("SPEC", "Tizen.NUI.Any.Assign M")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "MR")]
77 [Property("AUTHOR", "guowei.wang@samsung.com")]
78 public void AnyAssign()
80 tlog.Debug(tag, $"AnyAssign START");
82 using (Any any = new Any())
84 var testingTarget = new Any(any);
85 Assert.IsNotNull(testingTarget, "Can't create success object Any");
86 Assert.IsInstanceOf<Any>(testingTarget, "Should be an instance of Any type.");
90 any.Assign(testingTarget);
94 tlog.Debug(tag, e.Message.ToString());
95 Assert.Fail("Caught Exception: Failed!");
98 testingTarget.Dispose();
101 tlog.Debug(tag, $"AnyAssign END (OK)");
106 //[Description("Any AssertAlways.")]
107 //[Property("SPEC", "Tizen.NUI.Any.AssertAlways M")]
108 //[Property("SPEC_URL", "-")]
109 //[Property("CRITERIA", "MR")]
110 //[Property("AUTHOR", "guowei.wang@samsung.com")]
111 //public void AnyAssertAlways()
113 // tlog.Debug(tag, $"AnyAssertAlways START");
117 // Any.AssertAlways("This is the test for Any class.");
119 // catch (Exception e)
121 // tlog.Debug(tag, e.Message.ToString());
122 // Assert.Fail("Caught Exception: Failed!");
125 // tlog.Debug(tag, $"AnyAssertAlways END (OK)");
130 [Description("Any GetType.")]
131 [Property("SPEC", "Tizen.NUI.Any.GetType M")]
132 [Property("SPEC_URL", "-")]
133 [Property("CRITERIA", "MR")]
134 [Property("AUTHOR", "guowei.wang@samsung.com")]
135 public void AnyGetType()
137 tlog.Debug(tag, $"AnyGetType START");
139 using (Any any = new Any())
141 var testingTarget = new Any(any);
142 Assert.IsNotNull(testingTarget, "Can't create success object Any");
143 Assert.IsInstanceOf<Any>(testingTarget, "Should be an instance of Any type.");
147 testingTarget.GetType();
151 tlog.Debug(tag, e.Message.ToString());
152 Assert.Fail("Caught Exception: Failed!");
155 testingTarget.Dispose();
158 tlog.Debug(tag, $"AnyGetType END (OK)");
163 [Description("Any Empty.")]
164 [Property("SPEC", "Tizen.NUI.Any.Empty M")]
165 [Property("SPEC_URL", "-")]
166 [Property("CRITERIA", "MR")]
167 [Property("AUTHOR", "guowei.wang@samsung.com")]
168 public void AnyEmpty()
170 tlog.Debug(tag, $"AnyEmpty START");
172 using (Any any = new Any())
174 var testingTarget = new Any(any);
175 Assert.IsNotNull(testingTarget, "Can't create success object Any");
176 Assert.IsInstanceOf<Any>(testingTarget, "Should be an instance of Any type.");
180 var result = testingTarget.Empty();
181 tlog.Debug(tag, "result :" + result);
185 tlog.Debug(tag, e.Message.ToString());
186 Assert.Fail("Caught Exception: Failed!");
189 testingTarget.Dispose();
192 tlog.Debug(tag, $"AnyEmpty END (OK)");
197 [Description("Any.AnyContainerBase constructor.")]
198 [Property("SPEC", "Tizen.NUI.Any.AnyContainerBase.AnyContainerBase C")]
199 [Property("SPEC_URL", "-")]
200 [Property("CRITERIA", "CONSTR")]
201 [Property("AUTHOR", "guowei.wang@samsung.com")]
202 public void AnyContainerBaseConstructor()
204 tlog.Debug(tag, $"AnyContainerBaseConstructor START");
206 SWIGTYPE_p_std__type_info type = new SWIGTYPE_p_std__type_info(new View().SwigCPtr.Handle);
207 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new ImageView().SwigCPtr.Handle);
208 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new TextLabel().SwigCPtr.Handle);
210 var testingTarget = new Any.AnyContainerBase(type, cloneFunc, deleteFunc);
211 Assert.IsNotNull(testingTarget, "Can't create success object AnyContainerBase");
212 Assert.IsInstanceOf<Any.AnyContainerBase>(testingTarget, "Should be an instance of AnyContainerBase type.");
214 testingTarget.Dispose();
215 tlog.Debug(tag, $"AnyContainerBaseConstructor END (OK)");
220 [Description("Any.AnyContainerBase GetType.")]
221 [Property("SPEC", "Tizen.NUI.Any.AnyContainerBase.GetType M")]
222 [Property("SPEC_URL", "-")]
223 [Property("CRITERIA", "MR")]
224 [Property("AUTHOR", "guowei.wang@samsung.com")]
225 public void AnyContainerBaseGetType()
227 tlog.Debug(tag, $"AnyContainerBaseGetType START");
229 SWIGTYPE_p_std__type_info type = new SWIGTYPE_p_std__type_info(new View().SwigCPtr.Handle);
230 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new ImageView().SwigCPtr.Handle);
231 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new TextLabel().SwigCPtr.Handle);
233 var testingTarget = new Any.AnyContainerBase(type, cloneFunc, deleteFunc);
234 Assert.IsNotNull(testingTarget, "Can't create success object AnyContainerBase");
235 Assert.IsInstanceOf<Any.AnyContainerBase>(testingTarget, "Should be an instance of AnyContainerBase type.");
239 testingTarget.GetType();
243 tlog.Debug(tag, e.Message.ToString());
244 Assert.Fail("Caught Exception: Failed!");
247 testingTarget.Dispose();
248 tlog.Debug(tag, $"AnyContainerBaseGetType END (OK)");
253 [Description("Any.AnyContainerBase mType.")]
254 [Property("SPEC", "Tizen.NUI.Any.AnyContainerBase.mType A")]
255 [Property("SPEC_URL", "-")]
256 [Property("CRITERIA", "PRO")]
257 [Property("AUTHOR", "guowei.wang@samsung.com")]
258 public void AnyContainerBasemType()
260 tlog.Debug(tag, $"AnyContainerBasemType START");
262 SWIGTYPE_p_std__type_info type = new SWIGTYPE_p_std__type_info(new View().SwigCPtr.Handle);
263 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new ImageView().SwigCPtr.Handle);
264 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new TextLabel().SwigCPtr.Handle);
266 var testingTarget = new Any.AnyContainerBase(type, cloneFunc, deleteFunc);
267 Assert.IsNotNull(testingTarget, "Can't create success object AnyContainerBase");
268 Assert.IsInstanceOf<Any.AnyContainerBase>(testingTarget, "Should be an instance of AnyContainerBase type.");
270 tlog.Debug(tag, "mType : " + testingTarget.mType);
272 testingTarget.Dispose();
273 tlog.Debug(tag, $"AnyContainerBasemType END (OK)");
278 [Description("Any.AnyContainerBase mCloneFunc.")]
279 [Property("SPEC", "Tizen.NUI.Any.AnyContainerBase.mCloneFunc A")]
280 [Property("SPEC_URL", "-")]
281 [Property("CRITERIA", "PRO")]
282 [Property("AUTHOR", "guowei.wang@samsung.com")]
283 public void AnyContainerBasemCloneFunc()
285 tlog.Debug(tag, $"AnyContainerBasemCloneFunc START");
287 SWIGTYPE_p_std__type_info type = new SWIGTYPE_p_std__type_info(new View().SwigCPtr.Handle);
288 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new ImageView().SwigCPtr.Handle);
289 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new TextLabel().SwigCPtr.Handle);
291 var testingTarget = new Any.AnyContainerBase(type, cloneFunc, deleteFunc);
292 Assert.IsNotNull(testingTarget, "Can't create success object AnyContainerBase");
293 Assert.IsInstanceOf<Any.AnyContainerBase>(testingTarget, "Should be an instance of AnyContainerBase type.");
295 tlog.Debug(tag, "mType : " + testingTarget.mCloneFunc);
297 testingTarget.mCloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new TextLabel().SwigCPtr.Handle);
298 tlog.Debug(tag, "mType : " + testingTarget.mCloneFunc);
300 testingTarget.Dispose();
301 tlog.Debug(tag, $"AnyContainerBasemCloneFunc END (OK)");
306 [Description("Any.AnyContainerBase mDeleteFunc.")]
307 [Property("SPEC", "Tizen.NUI.Any.AnyContainerBase.mDeleteFunc A")]
308 [Property("SPEC_URL", "-")]
309 [Property("CRITERIA", "PRO")]
310 [Property("AUTHOR", "guowei.wang@samsung.com")]
311 public void AnyContainerBasemDeleteFunc()
313 tlog.Debug(tag, $"AnyContainerBasemDeleteFunc START");
315 SWIGTYPE_p_std__type_info type = new SWIGTYPE_p_std__type_info(new View().SwigCPtr.Handle);
316 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new ImageView().SwigCPtr.Handle);
317 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new TextLabel().SwigCPtr.Handle);
319 var testingTarget = new Any.AnyContainerBase(type, cloneFunc, deleteFunc);
320 Assert.IsNotNull(testingTarget, "Can't create success object AnyContainerBase");
321 Assert.IsInstanceOf<Any.AnyContainerBase>(testingTarget, "Should be an instance of AnyContainerBase type.");
323 tlog.Debug(tag, "mType : " + testingTarget.mDeleteFunc);
325 testingTarget.mDeleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new ImageView().SwigCPtr.Handle);
326 tlog.Debug(tag, "mType : " + testingTarget.mDeleteFunc);
328 testingTarget.Dispose();
329 tlog.Debug(tag, $"AnyContainerBasemDeleteFunc END (OK)");
334 [Description("Any.AnyContainerBase mContainer.")]
335 [Property("SPEC", "Tizen.NUI.Any.AnyContainerBase.mContainer A")]
336 [Property("SPEC_URL", "-")]
337 [Property("CRITERIA", "PRO")]
338 [Property("AUTHOR", "guowei.wang@samsung.com")]
339 public void AnyContainerBasemContainer()
341 tlog.Debug(tag, $"AnyContainerBasemContainer START");
343 using (Any any = new Any())
345 var testingTarget = new Any(any);
346 Assert.IsNotNull(testingTarget, "Can't create success object Any");
347 Assert.IsInstanceOf<Any>(testingTarget, "Should be an instance of Any type.");
349 tlog.Debug(tag, "mContainer : " + testingTarget.mContainer);
351 SWIGTYPE_p_std__type_info type = new SWIGTYPE_p_std__type_info(new View().SwigCPtr.Handle);
352 SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase cloneFunc = new SWIGTYPE_p_f_r_q_const__Dali__Any__AnyContainerBase__p_Dali__Any__AnyContainerBase(new ImageView().SwigCPtr.Handle);
353 SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void deleteFunc = new SWIGTYPE_p_f_p_q_const__Dali__Any__AnyContainerBase__void(new TextLabel().SwigCPtr.Handle);
354 Any.AnyContainerBase container = new Any.AnyContainerBase(type, cloneFunc, deleteFunc);
358 testingTarget.mContainer = container;
359 tlog.Debug(tag, "mContainer : " + testingTarget.mContainer);
363 tlog.Debug(tag, e.Message.ToString());
364 Assert.Fail("Caught Exception: Failed!");
368 tlog.Debug(tag, $"AnyContainerBasemContainer END (OK)");