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/ComponentApplication")]
13 public class InternalComponentApplicationTest
15 private const string tag = "NUITEST";
16 private string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
17 private delegate bool dummyCallback(IntPtr application);
18 private bool OnDummyCallback(IntPtr data)
26 tlog.Info(tag, "Init() is called!");
32 tlog.Info(tag, "Destroy() is called!");
36 [Description("ComponentApplication NewComponentApplication")]
37 [Property("AUTHOR", "guowei.wang@samsung.com")]
38 public void ComponentApplicationNewComponentApplication()
40 tlog.Debug(tag, $"ComponentApplicationNewComponentApplication START");
42 var args = new string[] { "Dali-demo" };
43 var stylesheet = resource + "/style/Test_Style_Manager.json";
44 var testingTarget = ComponentApplication.NewComponentApplication(args, stylesheet);
45 Assert.IsNotNull(testingTarget, "should be not null");
46 Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
48 testingTarget.Dispose();
49 tlog.Debug(tag, $"ComponentApplicationNewComponentApplication END (OK)");
53 [Description("ComponentApplication New")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void ComponentApplicationNew()
57 tlog.Debug(tag, $"ComponentApplicationNew START");
59 var args = new string[] { "Dali-demo" };
60 var stylesheet = resource + "/style/Test_Style_Manager.json";
61 var testingTarget = ComponentApplication.New(args, stylesheet);
62 Assert.IsNotNull(testingTarget, "should be not null");
63 Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
65 testingTarget.Dispose();
66 tlog.Debug(tag, $"ComponentApplicationNew END (OK)");
70 [Description("ComponentApplication connection")]
71 [Property("AUTHOR", "guowei.wang@samsung.com")]
72 public void ComponentApplicationConnection()
74 tlog.Debug(tag, $"ComponentApplicationConnection START");
76 var args = new string[] { "Dali-demo" };
77 var stylesheet = resource + "/style/Test_Style_Manager.json";
78 var testingTarget = ComponentApplication.NewComponentApplication(args, stylesheet);
79 Assert.IsNotNull(testingTarget, "should be not null");
80 Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
82 dummyCallback callback = OnDummyCallback;
83 testingTarget.Connect(callback);
84 testingTarget.Disconnect(callback);
85 testingTarget.Dispose();
87 tlog.Debug(tag, $"ComponentApplicationConnection END (OK)");
91 [Description("ComponentApplication disconnection")]
92 [Property("AUTHOR", "guowei.wang@samsung.com")]
93 public void ComponentApplicationDisconnection()
95 tlog.Debug(tag, $"ComponentApplicationDisconnection START");
97 var args = new string[] { "Dali-demo" };
98 var stylesheet = resource + "/style/Test_Style_Manager.json";
99 var testingTarget = ComponentApplication.NewComponentApplication(args, stylesheet);
100 Assert.IsNotNull(testingTarget, "should be not null");
101 Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
103 dummyCallback callback = OnDummyCallback;
104 testingTarget.Connect(callback);
105 testingTarget.Disconnect(callback);
106 testingTarget.Dispose();
108 tlog.Debug(tag, $"ComponentApplicationDisconnection END (OK)");