Release 9.0.0.16429
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Application / TSComponentApplication.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/ComponentApplication")]
13     public class InternalComponentApplicationTest
14     {
15         private const string tag = "NUITEST";
16         private string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
17         private delegate bool dummyCallback(IntPtr application);
18
19         private bool OnDummyCallback(IntPtr data)
20         {
21             return false;
22         }
23
24         [SetUp]
25         public void Init()
26         {
27             tlog.Info(tag, "Init() is called!");
28         }
29
30         [TearDown]
31         public void Destroy()
32         {
33             tlog.Info(tag, "Destroy() is called!");
34         }
35
36         [Test]
37         [Category("P1")]
38         [Description("ComponentApplication constructor.")]
39         [Property("SPEC", "Tizen.NUI.ComponentApplication.ComponentApplication C")]
40         [Property("SPEC_URL", "-")]
41         [Property("CRITERIA", "CONSTR")]
42         [Property("AUTHOR", "guowei.wang@samsung.com")]
43         public void ComponentApplicationConstructor()
44         {
45             tlog.Debug(tag, $"ComponentApplicationConstructor START");
46
47             using (Widget widget = new Widget())
48             {
49                 var testingTarget = new ComponentApplication(widget.SwigCPtr.Handle, true);
50                 Assert.IsNotNull(testingTarget, "should be not null");
51                 Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
52
53                 testingTarget.Dispose();
54             }
55
56             tlog.Debug(tag, $"ComponentApplicationConstructor END (OK)");
57         }
58
59         [Test]
60         [Category("P1")]
61         [Description("ComponentApplication CreateNativeSignal.")]
62         [Property("SPEC", "Tizen.NUI.ComponentApplication.CreateNativeSignal M")]
63         [Property("SPEC_URL", "-")]
64         [Property("CRITERIA", "MR")]
65         [Property("AUTHOR", "guowei.wang@samsung.com")]
66         public void ComponentApplicationCreateNativeSignal()
67         {
68             tlog.Debug(tag, $"ComponentApplicationCreateNativeSignal START");
69
70             using (Widget widget = new Widget())
71             {
72                 var testingTarget = new ComponentApplication(widget.SwigCPtr.Handle, true);
73                 Assert.IsNotNull(testingTarget, "should be not null");
74                 Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
75
76                 var result = testingTarget.CreateNativeSignal();
77                 Assert.IsNotNull(result, "should be not null");
78                 Assert.IsInstanceOf<ApplicationSignal>(result, "should be an instance of ApplicationSignal class!");
79
80                 testingTarget.Dispose();
81             }
82
83             tlog.Debug(tag, $"ComponentApplicationCreateNativeSignal END (OK)");
84         }
85     }
86 }