3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 namespace Tizen.NUI.Devel.Tests
8 using tlog = Tizen.Log;
11 [Description("internal/Application/NUICoreBackend")]
12 public class InternalNUICoreBackendTest
14 private const string tag = "NUITEST";
15 private event EventHandler Created;
16 protected virtual void OnCreate()
18 Created?.Invoke(this, EventArgs.Empty);
24 tlog.Info(tag, "Init() is called!");
30 tlog.Info(tag, "Destroy() is called!");
34 [Description("NUICoreBackend constructor")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void NUICoreBackendConstructor()
38 tlog.Debug(tag, $"NUICoreBackendConstructor START");
40 var testingTarget = new NUICoreBackend();
41 Assert.IsNotNull(testingTarget, "should be not null");
42 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"NUICoreBackendConstructor END (OK)");
49 [Description("NUICoreBackend constructor with stylesheet")]
50 [Property("AUTHOR", "guowei.wang@samsung.com")]
51 public void NUICoreBackendConstructorWithStylesheet()
53 tlog.Debug(tag, $"NUICoreBackendConstructorWithStylesheet START");
55 var dummy = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/style/Test_Style_Manager.json";
56 var testingTarget = new NUICoreBackend(dummy);
57 Assert.IsNotNull(testingTarget, "should be not null");
58 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
60 testingTarget.Dispose();
61 tlog.Debug(tag, $"NUICoreBackendConstructorWithStylesheet END (OK)");
65 [Description("NUICoreBackend constructor with stylesheet and windowMode")]
66 [Property("AUTHOR", "guowei.wang@samsung.com")]
67 public void NUICoreBackendConstructorWithStylesheetAndWindowmode()
69 tlog.Debug(tag, $"NUICoreBackendConstructorWithStylesheetAndWindowmode START");
71 var dummy = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/style/Test_Style_Manager.json";
72 var testingTarget = new NUICoreBackend(dummy, NUIApplication.WindowMode.Opaque);
73 Assert.IsNotNull(testingTarget, "should be not null");
74 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
76 testingTarget.Dispose();
77 tlog.Debug(tag, $"NUICoreBackendConstructorWithStylesheetAndWindowmode END (OK)");
81 [Description("NUICoreBackend constructor with stylesheet, window mode, window size and window position")]
82 [Property("AUTHOR", "guowei.wang@samsung.com")]
83 public void NUICoreBackendConstructorWithMoreArgs()
85 tlog.Debug(tag, $"NUICoreBackendConstructorWithMoreArgs START");
87 var dummy = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/style/Test_Style_Manager.json";
88 var testingTarget = new NUICoreBackend(dummy, NUIApplication.WindowMode.Opaque, new Size(400, 400), new Position(200, 300));
89 Assert.IsNotNull(testingTarget, "should be not null");
90 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
92 testingTarget.Dispose();
93 tlog.Debug(tag, $"NUICoreBackendConstructorWithMoreArgs END (OK)");
97 [Description("NUICoreBackend AddEventHandler")]
98 [Property("AUTHOR", "guowei.wang@samsung.com")]
99 public void NUICoreBackendAddEventHandler()
101 tlog.Debug(tag, $"NUICoreBackendAddEventHandler START");
103 var testingTarget = new NUICoreBackend();
104 Assert.IsNotNull(testingTarget, "should be not null");
105 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
107 testingTarget.AddEventHandler(Tizen.Applications.CoreBackend.EventType.Created, OnCreate);
109 testingTarget.Dispose();
110 tlog.Debug(tag, $"NUICoreBackendAddEventHandler END (OK)");
114 [Description("NUICoreBackend dispose")]
115 [Property("AUTHOR", "guowei.wang@samsung.com")]
116 public void NUICoreBackendDispose()
118 tlog.Debug(tag, $"NUICoreBackendDispose START");
120 var testingTarget = new NUICoreBackend();
121 Assert.IsNotNull(testingTarget, "should be not null");
122 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
126 testingTarget.Dispose();
130 tlog.Error(tag, "Caught Exception" + e.ToString());
131 Assert.Fail("Caught Exception" + e.ToString());
134 tlog.Debug(tag, $"NUICoreBackendDispose END (OK)");
138 [Description("NUICoreBackend exit")]
139 [Property("AUTHOR", "guowei.wang@samsung.com")]
140 public void NUICoreBackendExit()
142 tlog.Debug(tag, $"NUICoreBackendExit START");
144 var testingTarget = new NUICoreBackend();
145 Assert.IsNotNull(testingTarget, "should be not null");
146 Assert.IsInstanceOf<NUICoreBackend>(testingTarget, "should be an instance of testing target class!");
150 testingTarget.Exit();
154 tlog.Error(tag, "Caught Exception" + e.ToString());
155 Assert.Fail("Caught Exception" + e.ToString());
158 testingTarget.Dispose();
159 tlog.Debug(tag, $"NUICoreBackendExit END (OK)");