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/Application/Application")]
13 public class InternalApplicationTest
15 private const string tag = "NUITEST";
16 private delegate bool dummyCallback(IntPtr application);
17 private bool OnDummyCallback(IntPtr data)
25 tlog.Info(tag, "Init() is called!");
31 tlog.Info(tag, "Destroy() is called!");
35 [Description("NUIApplicationInitEventArgs Get")]
36 [Property("AUTHOR", "guowei.wang@samsung.com")]
37 public void NUIApplicationInitEventArgsGet()
39 tlog.Debug(tag, $"NUIApplicationInitEventArgsGet START");
41 var testingTarget = new NUIApplicationInitEventArgs();
42 Assert.IsNotNull(testingTarget, "should be not null");
43 Assert.IsInstanceOf<NUIApplicationInitEventArgs>(testingTarget, "should be an instance of testing target class!");
45 var result = testingTarget.Application;
46 Assert.IsNull(result);
48 tlog.Debug(tag, $"NUIApplicationInitEventArgsGet END (OK)");
52 [Description("NUIApplicationInitEventArgs Set")]
53 [Property("AUTHOR", "guowei.wang@samsung.com")]
54 public void NUIApplicationInitEventArgsSet()
56 tlog.Debug(tag, $"NUIApplicationInitEventArgsSet START");
58 var testingTarget = new NUIApplicationInitEventArgs();
59 Assert.IsNotNull(testingTarget, "should be not null");
60 Assert.IsInstanceOf<NUIApplicationInitEventArgs>(testingTarget, "should be an instance of testing target class!");
62 var g_result = testingTarget.Application;
63 Assert.IsNull(g_result);
65 testingTarget.Application = Application.Current;
66 var s_result = testingTarget.Application;
67 Assert.IsNotNull(s_result);
69 tlog.Debug(tag, $"NUIApplicationInitEventArgsSet END (OK)");
73 [Description("NUIApplicationTerminatingEventArgs Get")]
74 [Property("AUTHOR", "guowei.wang@samsung.com")]
75 public void NUIApplicationTerminatingEventArgsGet()
77 tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsGet START");
79 var testingTarget = new NUIApplicationTerminatingEventArgs();
80 Assert.IsNotNull(testingTarget, "should be not null");
81 Assert.IsInstanceOf<NUIApplicationTerminatingEventArgs>(testingTarget, "should be an instance of testing target class!");
83 var result = testingTarget.Application;
84 Assert.IsNull(result);
86 tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsGet END (OK)");
90 [Description("NUIApplicationTerminatingEventArgs Set")]
91 [Property("AUTHOR", "guowei.wang@samsung.com")]
92 public void NUIApplicationTerminatingEventArgsSet()
94 tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsSet START");
96 var testingTarget = new NUIApplicationTerminatingEventArgs();
97 Assert.IsNotNull(testingTarget, "should be not null");
98 Assert.IsInstanceOf<NUIApplicationTerminatingEventArgs>(testingTarget, "should be an instance of testing target class!");
100 var g_result = testingTarget.Application;
101 Assert.IsNull(g_result);
103 testingTarget.Application = Application.Current;
104 var s_result = testingTarget.Application;
105 Assert.IsNotNull(s_result);
107 tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsSet END (OK)");
111 [Description("NUIApplicationPausedEventArgs Get")]
112 [Property("AUTHOR", "guowei.wang@samsung.com")]
113 public void NUIApplicationPausedEventArgsGet()
115 tlog.Debug(tag, $"NUIApplicationPausedEventArgsGet START");
117 var testingTarget = new NUIApplicationPausedEventArgs();
118 Assert.IsNotNull(testingTarget, "should be not null");
119 Assert.IsInstanceOf<NUIApplicationPausedEventArgs>(testingTarget, "should be an instance of testing target class!");
121 var result = testingTarget.Application;
122 Assert.IsNull(result);
124 tlog.Debug(tag, $"NUIApplicationPausedEventArgsGet END (OK)");
128 [Description("NUIApplicationPausedEventArgs Set")]
129 [Property("AUTHOR", "guowei.wang@samsung.com")]
130 public void NUIApplicationPausedEventArgsSet()
132 tlog.Debug(tag, $"NUIApplicationPausedEventArgsSet START");
134 var testingTarget = new NUIApplicationPausedEventArgs();
135 Assert.IsNotNull(testingTarget, "should be not null");
136 Assert.IsInstanceOf<NUIApplicationPausedEventArgs>(testingTarget, "should be an instance of testing target class!");
138 var g_result = testingTarget.Application;
139 Assert.IsNull(g_result);
141 testingTarget.Application = Application.Current;
142 var s_result = testingTarget.Application;
143 Assert.IsNotNull(s_result);
145 tlog.Debug(tag, $"NUIApplicationPausedEventArgsSet END (OK)");
149 [Description("NUIApplicationResumedEventArgs Get")]
150 [Property("AUTHOR", "guowei.wang@samsung.com")]
151 public void NUIApplicationResumedEventArgsGet()
153 tlog.Debug(tag, $"NUIApplicationResumedEventArgsGet START");
155 var testingTarget = new NUIApplicationResumedEventArgs();
156 Assert.IsNotNull(testingTarget, "should be not null");
157 Assert.IsInstanceOf<NUIApplicationResumedEventArgs>(testingTarget, "should be an instance of testing target class!");
159 var result = testingTarget.Application;
160 Assert.IsNull(result);
162 tlog.Debug(tag, $"NUIApplicationResumedEventArgsGet END (OK)");
166 [Description("NUIApplicationResumedEventArgs Set")]
167 [Property("AUTHOR", "guowei.wang@samsung.com")]
168 public void NUIApplicationResumedEventArgsSet()
170 tlog.Debug(tag, $"NUIApplicationResumedEventArgsSet START");
172 var testingTarget = new NUIApplicationResumedEventArgs();
173 Assert.IsNotNull(testingTarget, "should be not null");
174 Assert.IsInstanceOf<NUIApplicationResumedEventArgs>(testingTarget, "should be an instance of testing target class!");
176 var g_result = testingTarget.Application;
177 Assert.IsNull(g_result);
179 testingTarget.Application = Application.Current;
180 var s_result = testingTarget.Application;
181 Assert.IsNotNull(s_result);
183 tlog.Debug(tag, $"NUIApplicationResumedEventArgsSet END (OK)");
187 [Description("NUIApplicationResetEventArgs Get")]
188 [Property("AUTHOR", "guowei.wang@samsung.com")]
189 public void NUIApplicationResetEventArgsGet()
191 tlog.Debug(tag, $"NUIApplicationResetEventArgsGet START");
193 var testingTarget = new NUIApplicationResetEventArgs();
194 Assert.IsNotNull(testingTarget);
195 Assert.IsInstanceOf<NUIApplicationResetEventArgs>(testingTarget, "should be an instance of testing target class!");
197 var result = testingTarget.Application;
198 Assert.IsNull(result);
200 tlog.Debug(tag, $"NUIApplicationResetEventArgsGet END (OK)");
204 [Description("NUIApplicationResetEventArgs Set")]
205 [Property("AUTHOR", "guowei.wang@samsung.com")]
206 public void NUIApplicationResetEventArgsSet()
208 tlog.Debug(tag, $"NUIApplicationResetEventArgsSet START");
210 var testingTarget = new NUIApplicationResetEventArgs();
211 Assert.IsNotNull(testingTarget, "should be not null");
212 Assert.IsInstanceOf<NUIApplicationResetEventArgs>(testingTarget, "should be an instance of testing target class!");
214 var g_result = testingTarget.Application;
215 Assert.IsNull(g_result);
217 testingTarget.Application = Application.Current;
218 var s_result = testingTarget.Application;
219 Assert.IsNotNull(s_result);
221 tlog.Debug(tag, $"NUIApplicationResetEventArgsSet END (OK)");
225 [Description("NUIApplicationLanguageChangedEventArgs Get")]
226 [Property("AUTHOR", "guowei.wang@samsung.com")]
227 public void NUIApplicationLanguageChangedEventArgsGet()
229 tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsGet START");
231 var testingTarget = new NUIApplicationLanguageChangedEventArgs();
232 Assert.IsNotNull(testingTarget, "should be not null");
233 Assert.IsInstanceOf<NUIApplicationLanguageChangedEventArgs>(testingTarget, "should be an instance of testing target class!");
235 var result = testingTarget.Application;
236 Assert.IsNull(result);
238 tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsGet END (OK)");
242 [Description("NUIApplicationLanguageChangedEventArgs Set")]
243 [Property("AUTHOR", "guowei.wang@samsung.com")]
244 public void NUIApplicationLanguageChangedEventArgsSet()
246 tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsSet START");
248 var testingTarget = new NUIApplicationLanguageChangedEventArgs();
249 Assert.IsNotNull(testingTarget, "should be not null");
250 Assert.IsInstanceOf<NUIApplicationLanguageChangedEventArgs>(testingTarget, "should be an instance of testing target class!");
252 var g_result = testingTarget.Application;
253 Assert.IsNull(g_result);
255 testingTarget.Application = Application.Current;
256 var s_result = testingTarget.Application;
257 Assert.IsNotNull(s_result);
259 tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsSet END (OK)");
263 [Description("NUIApplicationRegionChangedEventArgs Get")]
264 [Property("AUTHOR", "guowei.wang@samsung.com")]
265 public void NUIApplicationRegionChangedEventArgsGet()
267 tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsGet START");
269 var testingTarget = new NUIApplicationRegionChangedEventArgs();
270 Assert.IsNotNull(testingTarget, "should be not null");
271 Assert.IsInstanceOf<NUIApplicationRegionChangedEventArgs>(testingTarget, "should be an instance of testing target class!");
273 var result = testingTarget.Application;
274 Assert.IsNull(result);
276 tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsGet END (OK)");
280 [Description("NUIApplicationRegionChangedEventArgs Set")]
281 [Property("AUTHOR", "guowei.wang@samsung.com")]
282 public void NUIApplicationRegionChangedEventArgsSet()
284 tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsSet START");
286 var testingTarget = new NUIApplicationRegionChangedEventArgs();
287 Assert.IsNotNull(testingTarget, "should be not null");
288 Assert.IsInstanceOf<NUIApplicationRegionChangedEventArgs>(testingTarget, "should be an instance of testing target class!");
290 var g_result = testingTarget.Application;
291 Assert.IsNull(g_result);
293 testingTarget.Application = Application.Current;
294 var s_result = testingTarget.Application;
295 Assert.IsNotNull(s_result);
297 tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsSet END (OK)");
301 [Description("NUIApplicationBatteryLowEventArgs BatteryStatus Get")]
302 [Property("AUTHOR", "guowei.wang@samsung.com")]
303 public void NUIApplicationBatteryLowEventArgsBatteryStatusGet()
305 tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusGet START");
307 var testingTarget = new NUIApplicationBatteryLowEventArgs();
308 Assert.IsNotNull(testingTarget, "should be not null");
309 Assert.IsInstanceOf<NUIApplicationBatteryLowEventArgs>(testingTarget, "should be an instance of testing target class!");
311 var result = testingTarget.BatteryStatus;
312 Assert.IsNotNull(result, "should be not null");
314 tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusGet END (OK)");
318 [Description("NUIApplicationBatteryLowEventArgs BatteryStatus Set")]
319 [Property("AUTHOR", "guowei.wang@samsung.com")]
320 public void NUIApplicationBatteryLowEventArgsBatteryStatusSet()
322 tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusSet START");
324 var testingTarget = new NUIApplicationBatteryLowEventArgs();
325 Assert.IsNotNull(testingTarget, "should be not null");
326 Assert.IsInstanceOf<NUIApplicationBatteryLowEventArgs>(testingTarget, "should be an instance of testing target class!");
328 var status = Application.BatteryStatus.Normal;
329 testingTarget.BatteryStatus = status;
331 var result = testingTarget.BatteryStatus;
332 Assert.IsNotNull(testingTarget, "should be not null");
333 Assert.AreEqual(status, result, "Retrieved result should be equal to status.");
335 tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusSet END (OK)");
339 [Description("NUIApplicationMemoryLowEventArgs MemoryStatus Get")]
340 [Property("AUTHOR", "guowei.wang@samsung.com")]
341 public void NUIApplicationMemoryLowEventArgsMemoryStatusGet()
343 tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusGet START");
345 var testingTarget = new NUIApplicationMemoryLowEventArgs();
346 Assert.IsNotNull(testingTarget, "should be not null");
347 Assert.IsInstanceOf<NUIApplicationMemoryLowEventArgs>(testingTarget, "should be an instance of testing target class!");
349 var result = testingTarget.MemoryStatus;
350 Assert.IsNotNull(result, "should be not null");
352 tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusGet END (OK)");
356 [Description("NUIApplicationMemoryLowEventArgs MemoryStatus Set")]
357 [Property("AUTHOR", "guowei.wang@samsung.com")]
358 public void NUIApplicationMemoryLowEventArgsMemoryStatusSet()
360 tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusSet START");
362 var testingTarget = new NUIApplicationMemoryLowEventArgs();
363 Assert.IsNotNull(testingTarget, "should be not null");
364 Assert.IsInstanceOf<NUIApplicationMemoryLowEventArgs>(testingTarget, "should be an instance of testing target class!");
366 var status = Application.MemoryStatus.Normal;
367 testingTarget.MemoryStatus = status;
369 var result = testingTarget.MemoryStatus;
370 Assert.IsNotNull(testingTarget, "should be not null");
371 Assert.AreEqual(status, result, "Retrieved result should be equal to status.");
373 tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusSet END (OK)");
377 [Description("NUIApplicationAppControlEventArgs Application Get")]
378 [Property("AUTHOR", "guowei.wang@samsung.com")]
379 public void NUIApplicationAppControlEventArgsApplicationGet()
381 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationGet START");
383 var testingTarget = new NUIApplicationAppControlEventArgs();
384 Assert.IsNotNull(testingTarget, "should be not null");
385 Assert.IsInstanceOf<NUIApplicationAppControlEventArgs>(testingTarget, "should be an instance of testing target class!");
387 var result = testingTarget.Application;
388 Assert.IsNull(result, "should be null");
390 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationGet END (OK)");
394 [Description("NUIApplicationAppControlEventArgs Application Set")]
395 [Property("AUTHOR", "guowei.wang@samsung.com")]
396 public void NUIApplicationAppControlEventArgsApplicationSet()
398 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationSet START");
400 var testingTarget = new NUIApplicationAppControlEventArgs();
401 Assert.IsNotNull(testingTarget, "should be not null");
402 Assert.IsInstanceOf<NUIApplicationAppControlEventArgs>(testingTarget, "should be an instance of testing target class!");
404 var g_result = testingTarget.Application;
405 Assert.IsNull(g_result);
407 testingTarget.Application = Application.Current;
408 var s_result = testingTarget.Application;
409 Assert.IsNotNull(s_result);
411 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationSet END (OK)");
415 [Description("NUIApplicationAppControlEventArgs VoidP Get")]
416 [Property("AUTHOR", "guowei.wang@samsung.com")]
417 public void NUIApplicationAppControlEventArgsVoidPGet()
419 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPGet START");
421 var testingTarget = new NUIApplicationAppControlEventArgs();
422 Assert.IsNotNull(testingTarget, "should be not null");
423 Assert.IsInstanceOf<NUIApplicationAppControlEventArgs>(testingTarget, "should be an instance of testing target class!");
425 var result = testingTarget.VoidP;
426 Assert.IsNotNull(result, "should be not null");
428 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPGet END (OK)");
432 [Description("NUIApplicationAppControlEventArgs VoidP Set")]
433 [Property("AUTHOR", "guowei.wang@samsung.com")]
434 public void NUIApplicationAppControlEventArgsVoidPSet()
436 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPSet START");
438 var dummy = new global::System.IntPtr(0);
439 var testingTarget = new NUIApplicationAppControlEventArgs();
440 Assert.IsNotNull(testingTarget, "should be not null");
441 Assert.IsInstanceOf<NUIApplicationAppControlEventArgs>(testingTarget, "should be an instance of testing target class!");
443 testingTarget.VoidP = dummy;
445 var result = testingTarget.VoidP;
446 Assert.IsNotNull(testingTarget, "should be not null");
447 Assert.AreEqual(dummy, result, "Retrieved result should be equal to dummy.");
449 tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPSet END (OK)");