[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Application / TSNUIFrameComponent.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("public/Application/NUIFrameComponent")]
13     class PublicNUIFrameComponentTest
14     {
15         private const string tag = "NUITEST";
16
17         internal class MyNUIFrameComponent : NUIFrameComponent
18         {
19             public MyNUIFrameComponent() : base()
20             { }
21
22             public void MyOnCreate()
23             {
24                 base.OnCreate();
25             }
26
27             public void MyOnStart(Tizen.Applications.AppControl appControl, bool restarted)
28             {
29                 base.OnStart(appControl, restarted);
30             }
31
32             public void MyOnResume()
33             {
34                 base.OnResume();
35             }
36
37             public void MyOnPause()
38             {
39                 base.OnPause();
40             }
41
42             public void MyOnStop()
43             {
44                 base.OnStop();
45             }
46
47             public void MyOnDestroy()
48             {
49                 base.OnDestroy();
50             }
51         }
52
53         [SetUp]
54         public void Init()
55         {
56             tlog.Info(tag, "Init() is called!");
57         }
58
59         [TearDown]
60         public void Destroy()
61         {
62             tlog.Info(tag, "Destroy() is called!");
63         }
64
65         [Test]
66         [Category("P1")]
67         [Description("NUIFrameComponent NUIWindowInfo")]
68         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.NUIWindowInfo A")]
69         [Property("SPEC_URL", "-")]
70         [Property("CRITERIA", "PRW")]
71         [Property("AUTHOR", "guowei.wang@samsung.com")]
72         public void NUIFrameComponentNUIWindowInfo()
73         {
74             tlog.Debug(tag, $"NUIFrameComponentNUIWindowInfo START");
75
76             var testingTarget = new NUIFrameComponent();
77             Assert.IsNotNull(testingTarget, "Should be not null.");
78             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
79
80             testingTarget.NUIWindowInfo = new NUIWindowInfo(Window.Instance);
81             tlog.Debug(tag, "testingTarget.NUIWindowInfo : " + testingTarget.NUIWindowInfo);
82             Assert.IsNotNull(testingTarget.NUIWindowInfo);
83
84             tlog.Debug(tag, $"NUIFrameComponentNUIWindowInfo END (OK)");
85         }
86
87         [Test]
88         [Category("P1")]
89         [Description("NUIFrameComponent Window")]
90         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.Window A")]
91         [Property("SPEC_URL", "-")]
92         [Property("CRITERIA", "PRW")]
93         [Property("AUTHOR", "guowei.wang@samsung.com")]
94         public void NUIFrameComponentWindow()
95         {
96             tlog.Debug(tag, $"NUIFrameComponentWindow START");
97
98             var testingTarget = new NUIFrameComponent();
99             Assert.IsNotNull(testingTarget, "Should be not null.");
100             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
101
102             try
103             {
104                 testingTarget.Window = NUIApplication.GetDefaultWindow();
105                 tlog.Debug(tag, "Window :" + testingTarget.Window);
106             }
107             catch (Exception e)
108             {
109                 tlog.Debug(tag, e.Message.ToString());
110                 Assert.Fail("Caught Exception : Failed!");
111             }
112
113             tlog.Debug(tag, $"NUIFrameComponentWindow END (OK)");
114         }
115
116         [Test]
117         [Category("P1")]
118         [Description("NUIFrameComponent OnCreate.")]
119         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.OnCreate M")]
120         [Property("SPEC_URL", "-")]
121         [Property("CRITERIA", "MR")]
122         [Property("AUTHOR", "guowei.wang@samsung.com")]
123         public void NUIFrameComponentOnCreate()
124         {
125             tlog.Debug(tag, $"NUIFrameComponentOnCreate START");
126
127             var testingTarget = new MyNUIFrameComponent();
128             Assert.IsNotNull(testingTarget, "Should be not null.");
129             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
130
131             try
132             {
133                 testingTarget.MyOnCreate();
134             }
135             catch (Exception e)
136             {
137                 tlog.Debug(tag, e.Message.ToString());
138                 Assert.Fail("Caught Exception: Failed!");
139             }
140
141             tlog.Debug(tag, $"NUIFrameComponentOnCreate END (OK)");
142         }
143
144         [Test]
145         [Category("P1")]
146         [Description("NUIFrameComponent OnStart.")]
147         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.OnStart M")]
148         [Property("SPEC_URL", "-")]
149         [Property("CRITERIA", "MR")]
150         [Property("AUTHOR", "guowei.wang@samsung.com")]
151         public void NUIFrameComponentOnStart()
152         {
153             tlog.Debug(tag, $"NUIFrameComponentOnStart START");
154
155             var testingTarget = new MyNUIFrameComponent();
156             Assert.IsNotNull(testingTarget, "Should be not null.");
157             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
158
159             try
160             {
161                 Tizen.Applications.AppControl appControl = new Tizen.Applications.AppControl(true);
162                 testingTarget.MyOnStart(appControl, false);
163             }
164             catch (Exception e)
165             {
166                 tlog.Debug(tag, e.Message.ToString());
167                 Assert.Fail("Caught Exception: Failed!");
168             }
169
170             tlog.Debug(tag, $"NUIFrameComponentOnStart END (OK)");
171         }
172
173         [Test]
174         [Category("P1")]
175         [Description("NUIFrameComponent OnResume.")]
176         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.OnResume M")]
177         [Property("SPEC_URL", "-")]
178         [Property("CRITERIA", "MR")]
179         [Property("AUTHOR", "guowei.wang@samsung.com")]
180         public void NUIFrameComponentOnResume()
181         {
182             tlog.Debug(tag, $"NUIFrameComponentOnResume START");
183
184             var testingTarget = new MyNUIFrameComponent();
185             Assert.IsNotNull(testingTarget, "Should be not null.");
186             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
187
188             try
189             {
190                 testingTarget.MyOnResume();
191             }
192             catch (Exception e)
193             {
194                 tlog.Debug(tag, e.Message.ToString());
195                 Assert.Fail("Caught Exception: Failed!");
196             }
197
198             tlog.Debug(tag, $"NUIFrameComponentOnResume END (OK)");
199         }
200
201         [Test]
202         [Category("P1")]
203         [Description("NUIFrameComponent OnPause.")]
204         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.OnPause M")]
205         [Property("SPEC_URL", "-")]
206         [Property("CRITERIA", "MR")]
207         [Property("AUTHOR", "guowei.wang@samsung.com")]
208         public void NUIFrameComponentOnPause()
209         {
210             tlog.Debug(tag, $"NUIFrameComponentOnPause START");
211
212             var testingTarget = new MyNUIFrameComponent();
213             Assert.IsNotNull(testingTarget, "Should be not null.");
214             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
215
216             try
217             {
218                 testingTarget.MyOnPause();
219             }
220             catch (Exception e)
221             {
222                 tlog.Debug(tag, e.Message.ToString());
223                 Assert.Fail("Caught Exception: Failed!");
224             }
225
226             tlog.Debug(tag, $"NUIFrameComponentOnPause END (OK)");
227         }
228
229         [Test]
230         [Category("P1")]
231         [Description("NUIFrameComponent OnStop.")]
232         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.OnStop M")]
233         [Property("SPEC_URL", "-")]
234         [Property("CRITERIA", "MR")]
235         [Property("AUTHOR", "guowei.wang@samsung.com")]
236         public void NUIFrameComponentOnStop()
237         {
238             tlog.Debug(tag, $"NUIFrameComponentOnStop START");
239
240             var testingTarget = new MyNUIFrameComponent();
241             Assert.IsNotNull(testingTarget, "Should be not null.");
242             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
243
244             try
245             {
246                 testingTarget.MyOnStop();
247             }
248             catch (Exception e)
249             {
250                 tlog.Debug(tag, e.Message.ToString());
251                 Assert.Fail("Caught Exception: Failed!");
252             }
253
254             tlog.Debug(tag, $"NUIFrameComponentOnStop END (OK)");
255         }
256
257         [Test]
258         [Category("P1")]
259         [Description("NUIFrameComponent OnDestroy.")]
260         [Property("SPEC", "Tizen.NUI.NUIFrameComponent.OnDestroy M")]
261         [Property("SPEC_URL", "-")]
262         [Property("CRITERIA", "MR")]
263         [Property("AUTHOR", "guowei.wang@samsung.com")]
264         public void NUIFrameComponentOnDestroy()
265         {
266             tlog.Debug(tag, $"NUIFrameComponentOnDestroy START");
267
268             var testingTarget = new MyNUIFrameComponent();
269             Assert.IsNotNull(testingTarget, "Should be not null.");
270             Assert.IsInstanceOf<NUIFrameComponent>(testingTarget, "Should be an instance of NUIFrameComponent type.");
271
272             try
273             {
274                 testingTarget.MyOnDestroy();
275             }
276             catch (Exception e)
277             {
278                 tlog.Debug(tag, e.Message.ToString());
279                 Assert.Fail("Caught Exception: Failed!");
280             }
281
282             tlog.Debug(tag, $"NUIFrameComponentOnDestroy END (OK)");
283         }
284     }
285 }