Release 9.0.0.16429
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Application / TSApplication.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
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/Application/Application")]
13     public class InternalApplicationTest
14     {
15         private const string tag = "NUITEST";
16         private delegate bool dummyCallback(IntPtr application);
17         private bool OnDummyCallback(IntPtr data)
18         {
19             return false;
20         }
21
22         [SetUp]
23         public void Init()
24         {
25             tlog.Info(tag, "Init() is called!");
26         }
27
28         [TearDown]
29         public void Destroy()
30         {
31             tlog.Info(tag, "Destroy() is called!");
32         }
33
34         [Test]
35         [Description("NUIApplicationInitEventArgs Get")]
36         [Property("AUTHOR", "guowei.wang@samsung.com")]
37         public void NUIApplicationInitEventArgsGet()
38         {
39             tlog.Debug(tag, $"NUIApplicationInitEventArgsGet START");
40
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!");
44
45             var result = testingTarget.Application;
46             Assert.IsNull(result);
47
48             tlog.Debug(tag, $"NUIApplicationInitEventArgsGet END (OK)");
49         }
50
51         [Test]
52         [Description("NUIApplicationInitEventArgs Set")]
53         [Property("AUTHOR", "guowei.wang@samsung.com")]
54         public void NUIApplicationInitEventArgsSet()
55         {
56             tlog.Debug(tag, $"NUIApplicationInitEventArgsSet START");
57
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!");
61
62             var g_result = testingTarget.Application;
63             Assert.IsNull(g_result);
64
65             testingTarget.Application = Application.Current;
66             var s_result = testingTarget.Application;
67             Assert.IsNotNull(s_result);
68
69             tlog.Debug(tag, $"NUIApplicationInitEventArgsSet END (OK)");
70         }
71
72         [Test]
73         [Description("NUIApplicationTerminatingEventArgs Get")]
74         [Property("AUTHOR", "guowei.wang@samsung.com")]
75         public void NUIApplicationTerminatingEventArgsGet()
76         {
77             tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsGet START");
78
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!");
82
83             var result = testingTarget.Application;
84             Assert.IsNull(result);
85
86             tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsGet END (OK)");
87         }
88
89         [Test]
90         [Description("NUIApplicationTerminatingEventArgs Set")]
91         [Property("AUTHOR", "guowei.wang@samsung.com")]
92         public void NUIApplicationTerminatingEventArgsSet()
93         {
94             tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsSet START");
95
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!");
99
100             var g_result = testingTarget.Application;
101             Assert.IsNull(g_result);
102
103             testingTarget.Application = Application.Current;
104             var s_result = testingTarget.Application;
105             Assert.IsNotNull(s_result);
106
107             tlog.Debug(tag, $"NUIApplicationTerminatingEventArgsSet END (OK)");
108         }
109
110         [Test]
111         [Description("NUIApplicationPausedEventArgs Get")]
112         [Property("AUTHOR", "guowei.wang@samsung.com")]
113         public void NUIApplicationPausedEventArgsGet()
114         {
115             tlog.Debug(tag, $"NUIApplicationPausedEventArgsGet START");
116
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!");
120
121             var result = testingTarget.Application;
122             Assert.IsNull(result);
123
124             tlog.Debug(tag, $"NUIApplicationPausedEventArgsGet END (OK)");
125         }
126
127         [Test]
128         [Description("NUIApplicationPausedEventArgs Set")]
129         [Property("AUTHOR", "guowei.wang@samsung.com")]
130         public void NUIApplicationPausedEventArgsSet()
131         {
132             tlog.Debug(tag, $"NUIApplicationPausedEventArgsSet START");
133
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!");
137
138             var g_result = testingTarget.Application;
139             Assert.IsNull(g_result);
140
141             testingTarget.Application = Application.Current;
142             var s_result = testingTarget.Application;
143             Assert.IsNotNull(s_result);
144
145             tlog.Debug(tag, $"NUIApplicationPausedEventArgsSet END (OK)");
146         }
147
148         [Test]
149         [Description("NUIApplicationResumedEventArgs Get")]
150         [Property("AUTHOR", "guowei.wang@samsung.com")]
151         public void NUIApplicationResumedEventArgsGet()
152         {
153             tlog.Debug(tag, $"NUIApplicationResumedEventArgsGet START");
154
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!");
158
159             var result = testingTarget.Application;
160             Assert.IsNull(result);
161
162             tlog.Debug(tag, $"NUIApplicationResumedEventArgsGet END (OK)");
163         }
164
165         [Test]
166         [Description("NUIApplicationResumedEventArgs Set")]
167         [Property("AUTHOR", "guowei.wang@samsung.com")]
168         public void NUIApplicationResumedEventArgsSet()
169         {
170             tlog.Debug(tag, $"NUIApplicationResumedEventArgsSet START");
171
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!");
175
176             var g_result = testingTarget.Application;
177             Assert.IsNull(g_result);
178
179             testingTarget.Application = Application.Current;
180             var s_result = testingTarget.Application;
181             Assert.IsNotNull(s_result);
182
183             tlog.Debug(tag, $"NUIApplicationResumedEventArgsSet END (OK)");
184         }
185
186         [Test]
187         [Description("NUIApplicationResetEventArgs Get")]
188         [Property("AUTHOR", "guowei.wang@samsung.com")]
189         public void NUIApplicationResetEventArgsGet()
190         {
191             tlog.Debug(tag, $"NUIApplicationResetEventArgsGet START");
192
193             var testingTarget = new NUIApplicationResetEventArgs();
194             Assert.IsNotNull(testingTarget);
195             Assert.IsInstanceOf<NUIApplicationResetEventArgs>(testingTarget, "should be an instance of testing target class!");
196
197             var result = testingTarget.Application;
198             Assert.IsNull(result);
199
200             tlog.Debug(tag, $"NUIApplicationResetEventArgsGet END (OK)");
201         }
202
203         [Test]
204         [Description("NUIApplicationResetEventArgs Set")]
205         [Property("AUTHOR", "guowei.wang@samsung.com")]
206         public void NUIApplicationResetEventArgsSet()
207         {
208             tlog.Debug(tag, $"NUIApplicationResetEventArgsSet START");
209
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!");
213
214             var g_result = testingTarget.Application;
215             Assert.IsNull(g_result);
216
217             testingTarget.Application = Application.Current;
218             var s_result = testingTarget.Application;
219             Assert.IsNotNull(s_result);
220
221             tlog.Debug(tag, $"NUIApplicationResetEventArgsSet END (OK)");
222         }
223
224         [Test]
225         [Description("NUIApplicationLanguageChangedEventArgs Get")]
226         [Property("AUTHOR", "guowei.wang@samsung.com")]
227         public void NUIApplicationLanguageChangedEventArgsGet()
228         {
229             tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsGet START");
230
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!");
234
235             var result = testingTarget.Application;
236             Assert.IsNull(result);
237
238             tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsGet END (OK)");
239         }
240
241         [Test]
242         [Description("NUIApplicationLanguageChangedEventArgs Set")]
243         [Property("AUTHOR", "guowei.wang@samsung.com")]
244         public void NUIApplicationLanguageChangedEventArgsSet()
245         {
246             tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsSet START");
247
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!");
251
252             var g_result = testingTarget.Application;
253             Assert.IsNull(g_result);
254
255             testingTarget.Application = Application.Current;
256             var s_result = testingTarget.Application;
257             Assert.IsNotNull(s_result);
258
259             tlog.Debug(tag, $"NUIApplicationLanguageChangedEventArgsSet END (OK)");
260         }
261
262         [Test]
263         [Description("NUIApplicationRegionChangedEventArgs Get")]
264         [Property("AUTHOR", "guowei.wang@samsung.com")]
265         public void NUIApplicationRegionChangedEventArgsGet()
266         {
267             tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsGet START");
268
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!");
272
273             var result = testingTarget.Application;
274             Assert.IsNull(result);
275
276             tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsGet END (OK)");
277         }
278
279         [Test]
280         [Description("NUIApplicationRegionChangedEventArgs Set")]
281         [Property("AUTHOR", "guowei.wang@samsung.com")]
282         public void NUIApplicationRegionChangedEventArgsSet()
283         {
284             tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsSet START");
285
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!");
289
290             var g_result = testingTarget.Application;
291             Assert.IsNull(g_result);
292
293             testingTarget.Application = Application.Current;
294             var s_result = testingTarget.Application;
295             Assert.IsNotNull(s_result);
296
297             tlog.Debug(tag, $"NUIApplicationRegionChangedEventArgsSet END (OK)");
298         }
299
300         [Test]
301         [Description("NUIApplicationBatteryLowEventArgs BatteryStatus Get")]
302         [Property("AUTHOR", "guowei.wang@samsung.com")]
303         public void NUIApplicationBatteryLowEventArgsBatteryStatusGet()
304         {
305             tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusGet START");
306
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!");
310
311             var result = testingTarget.BatteryStatus;
312             Assert.IsNotNull(result, "should be not null");
313
314             tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusGet END (OK)");
315         }
316
317         [Test]
318         [Description("NUIApplicationBatteryLowEventArgs BatteryStatus Set")]
319         [Property("AUTHOR", "guowei.wang@samsung.com")]
320         public void NUIApplicationBatteryLowEventArgsBatteryStatusSet()
321         {
322             tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusSet START");
323
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!");
327
328             var status = Application.BatteryStatus.Normal;
329             testingTarget.BatteryStatus = status;
330
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.");
334
335             tlog.Debug(tag, $"NUIApplicationBatteryLowEventArgsBatteryStatusSet END (OK)");
336         }
337
338         [Test]
339         [Description("NUIApplicationMemoryLowEventArgs MemoryStatus Get")]
340         [Property("AUTHOR", "guowei.wang@samsung.com")]
341         public void NUIApplicationMemoryLowEventArgsMemoryStatusGet()
342         {
343             tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusGet START");
344
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!");
348
349             var result = testingTarget.MemoryStatus;
350             Assert.IsNotNull(result, "should be not null");
351
352             tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusGet END (OK)");
353         }
354
355         [Test]
356         [Description("NUIApplicationMemoryLowEventArgs MemoryStatus Set")]
357         [Property("AUTHOR", "guowei.wang@samsung.com")]
358         public void NUIApplicationMemoryLowEventArgsMemoryStatusSet()
359         {
360             tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusSet START");
361
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!");
365
366             var status = Application.MemoryStatus.Normal;
367             testingTarget.MemoryStatus = status;
368
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.");
372
373             tlog.Debug(tag, $"NUIApplicationMemoryLowEventArgsMemoryStatusSet END (OK)");
374         }
375
376         [Test]
377         [Description("NUIApplicationAppControlEventArgs Application Get")]
378         [Property("AUTHOR", "guowei.wang@samsung.com")]
379         public void NUIApplicationAppControlEventArgsApplicationGet()
380         {
381             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationGet START");
382
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!");
386
387             var result = testingTarget.Application;
388             Assert.IsNull(result, "should be null");
389
390             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationGet END (OK)");
391         }
392
393         [Test]
394         [Description("NUIApplicationAppControlEventArgs Application Set")]
395         [Property("AUTHOR", "guowei.wang@samsung.com")]
396         public void NUIApplicationAppControlEventArgsApplicationSet()
397         {
398             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationSet START");
399
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!");
403
404             var g_result = testingTarget.Application;
405             Assert.IsNull(g_result);
406
407             testingTarget.Application = Application.Current;
408             var s_result = testingTarget.Application;
409             Assert.IsNotNull(s_result);
410
411             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsApplicationSet END (OK)");
412         }
413
414         [Test]
415         [Description("NUIApplicationAppControlEventArgs VoidP Get")]
416         [Property("AUTHOR", "guowei.wang@samsung.com")]
417         public void NUIApplicationAppControlEventArgsVoidPGet()
418         {
419             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPGet START");
420
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!");
424
425             var result = testingTarget.VoidP;
426             Assert.IsNotNull(result, "should be not null");
427
428             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPGet END (OK)");
429         }
430
431         [Test]
432         [Description("NUIApplicationAppControlEventArgs VoidP Set")]
433         [Property("AUTHOR", "guowei.wang@samsung.com")]
434         public void NUIApplicationAppControlEventArgsVoidPSet()
435         {
436             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPSet START");
437
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!");
442
443             testingTarget.VoidP = dummy;
444
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.");
448
449             tlog.Debug(tag, $"NUIApplicationAppControlEventArgsVoidPSet END (OK)");
450         }
451     }
452 }