1 using NUnit.Framework;
3 using System.Collections.Generic;
4 using static Tizen.NUI.Window;
6 namespace Tizen.NUI.Devel.Tests
8 using tlog = Tizen.Log;
11 [Description("public/Window/Window")]
12 internal class PublicWindowTest
14 private const string tag = "NUITEST";
15 private static Window myWin;
19 Rectangle r1 = new Rectangle(0, 0, 20, 20);
20 myWin = new Window(r1);
21 tlog.Info(tag, "Init() is called!");
32 tlog.Info(tag, "Destroy() is called!");
37 [Description("Window WindowPositionSize")]
38 [Property("SPEC", "Tizen.NUI.Window.WindowPositionSize A")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "PRW")]
41 public void WindowWindowPositionSize()
43 tlog.Debug(tag, $"WindowWindowPositionSize START");
47 myWin.WindowPositionSize = new Rectangle(1, 2, 3, 4);
51 tlog.Debug(tag, e.Message.ToString());
52 Assert.Fail("Caught Exception : Failed!");
55 tlog.Debug(tag, $"WindowWindowPositionSize END (OK)");
60 //[Description("Window DEFAULT_BACKGROUND_COLOR")]
61 //[Property("SPEC", "Tizen.NUI.Window.DEFAULT_BACKGROUND_COLOR A")]
62 //[Property("SPEC_URL", "-")]
63 //[Property("CRITERIA", "PRW")]
64 //public void WindowDEFAULT_BACKGROUND_COLOR()
66 // tlog.Debug(tag, $"WindowDEFAULT_BACKGROUND_COLOR START");
69 // Vector4 v1 = Window.DEFAULT_BACKGROUND_COLOR;
71 // catch (Exception e)
73 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
75 // Assert.Fail("Caught Exception" + e.ToString());
77 // tlog.Debug(tag, $"WindowDEFAULT_BACKGROUND_COLOR END (OK)");
78 // Assert.Pass("WindowDEFAULT_BACKGROUND_COLOR");
83 //[Description("Window DEBUG_BACKGROUND_COLOR")]
84 //[Property("SPEC", "Tizen.NUI.Window.DEBUG_BACKGROUND_COLOR A")]
85 //[Property("SPEC_URL", "-")]
86 //[Property("CRITERIA", "PRW")]
87 //public void WindowDEBUG_BACKGROUND_COLOR()
89 // tlog.Debug(tag, $"WindowDEBUG_BACKGROUND_COLOR START");
92 // Vector4 v1 = Window.DEBUG_BACKGROUND_COLOR;
94 // catch (Exception e)
96 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
98 // Assert.Fail("Caught Exception" + e.ToString());
100 // tlog.Debug(tag, $"WindowDEBUG_BACKGROUND_COLOR END (OK)");
101 // Assert.Pass("WindowDEBUG_BACKGROUND_COLOR");
106 [Description("Window GetLayer")]
107 [Property("SPEC", "Tizen.NUI.Window.GetLayer M")]
108 [Property("SPEC_URL", "-")]
109 [Property("CRITERIA", "MR")]
110 public void WindowGetLayer()
112 tlog.Debug(tag, $"WindowGetLayer START");
120 tlog.Debug(tag, e.Message.ToString());
121 Assert.Fail("Caught Exception : Failed!");
123 tlog.Debug(tag, $"WindowGetLayer END (OK)");
128 [Description("Window GetCurrentOrientation")]
129 [Property("SPEC", "Tizen.NUI.Window.GetCurrentOrientation M")]
130 [Property("SPEC_URL", "-")]
131 [Property("CRITERIA", "MR")]
132 public void WindowGetCurrentOrientation()
134 tlog.Debug(tag, $"WindowGetCurrentOrientation START");
138 myWin.GetCurrentOrientation();
142 tlog.Debug(tag, e.Message.ToString());
143 Assert.Fail("Caught Exception : Failed!");
146 tlog.Debug(tag, $"WindowGetCurrentOrientation END (OK)");
151 //[Description("Window SetAvailableOrientations")]
152 //[Property("SPEC", "Tizen.NUI.Window.SetAvailableOrientations M")]
153 //[Property("SPEC_URL", "-")]
154 //[Property("CRITERIA", "MR")]
155 //public void WindowSetAvailableOrientations()
157 // tlog.Debug(tag, $"WindowSetAvailableOrientations START");
160 // List<Window.WindowOrientation> l1 = new List<Window.WindowOrientation>();
162 // l1.Add(Window.WindowOrientation.Landscape);
163 // l1.Add(Window.WindowOrientation.LandscapeInverse);
164 // l1.Add(Window.WindowOrientation.NoOrientationPreference);
165 // l1.Add(Window.WindowOrientation.Portrait);
166 // l1.Add(Window.WindowOrientation.PortraitInverse);
168 // myWin.SetAvailableOrientations(l1);
170 // catch (Exception e)
172 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
173 // Assert.Fail("Caught Exception" + e.ToString());
176 // tlog.Debug(tag, $"WindowSetAvailableOrientations END (OK)");
177 // Assert.Pass("WindowSetAvailableOrientations");
182 [Description("Window GetNativeId")]
183 [Property("SPEC", "Tizen.NUI.Window.GetNativeId M")]
184 [Property("SPEC_URL", "-")]
185 [Property("CRITERIA", "MR")]
186 public void WindowGetNativeId()
188 tlog.Debug(tag, $"WindowGetNativeId START");
196 tlog.Debug(tag, e.Message.ToString());
197 Assert.Fail("Caught Exception : Failed!");
200 tlog.Debug(tag, $"WindowGetNativeId END (OK)");
205 [Description("Window GetNativeHandle")]
206 [Property("SPEC", "Tizen.NUI.Window.GetNativeHandle M")]
207 [Property("SPEC_URL", "-")]
208 [Property("CRITERIA", "MR")]
209 public void WindowGetNativeHandle()
211 tlog.Debug(tag, $"WindowGetNativeHandle START");
215 myWin.GetNativeHandle();
219 tlog.Debug(tag, e.Message.ToString());
220 Assert.Fail("Caught Exception : Failed!");
223 tlog.Debug(tag, $"WindowGetNativeHandle END (OK)");
228 [Description("Window Add")]
229 [Property("SPEC", "Tizen.NUI.Window.Add M")]
230 [Property("SPEC_URL", "-")]
231 [Property("CRITERIA", "MR")]
232 public void WindowAdd()
234 tlog.Debug(tag, $"WindowAdd START");
241 catch (ArgumentNullException e)
243 tlog.Debug(tag, e.Message.ToString());
244 tlog.Debug(tag, $"WindowAdd END (OK)");
245 Assert.Pass("Caught ArgumentNullException : Passed!");
251 [Description("Window Remove")]
252 [Property("SPEC", "Tizen.NUI.Window.Remove M")]
253 [Property("SPEC_URL", "-")]
254 [Property("CRITERIA", "MR")]
255 public void WindowRemove()
257 tlog.Debug(tag, $"WindowRemove START");
264 catch (ArgumentNullException e)
266 tlog.Debug(tag, e.Message.ToString());
267 tlog.Debug(tag, $"WindowRemove END (OK)");
268 Assert.Pass("Caught ArgumentNullException : Passed!");
274 [Description("Window GetRenderTaskList")]
275 [Property("SPEC", "Tizen.NUI.Window.GetRenderTaskList M")]
276 [Property("SPEC_URL", "-")]
277 [Property("CRITERIA", "MR")]
278 public void WindowGetRenderTaskList()
280 tlog.Debug(tag, $"WindowGetRenderTaskList START");
283 myWin.GetRenderTaskList();
287 tlog.Debug(tag, e.Message.ToString());
288 Assert.Fail("Caught Exception : Failed!");
291 tlog.Debug(tag, $"WindowGetRenderTaskList END (OK)");
296 //[Description("Window GetObjectRegistry")]
297 //[Property("SPEC", "Tizen.NUI.Window.GetObjectRegistry M")]
298 //[Property("SPEC_URL", "-")]
299 //[Property("CRITERIA", "MR")]
300 //public void WindowGetObjectRegistry()
302 // tlog.Debug(tag, $"WindowGetObjectRegistry START");
305 // myWin.GetObjectRegistry();
307 // catch (Exception e)
309 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
311 // Assert.Fail("Caught Exception" + e.ToString());
313 // tlog.Debug(tag, $"WindowGetObjectRegistry END (OK)");
314 // Assert.Pass("WindowGetObjectRegistry");
319 [Description("Window SetWindowSize")]
320 [Property("SPEC", "Tizen.NUI.Window.SetWindowSize M")]
321 [Property("SPEC_URL", "-")]
322 [Property("CRITERIA", "MR")]
323 public void WindowSetWindowSize()
325 tlog.Debug(tag, $"WindowSetWindowSize START");
330 myWin.SetWindowSize(s1);
332 catch (ArgumentNullException e)
334 tlog.Debug(tag, e.Message.ToString());
335 tlog.Debug(tag, $"WindowSetWindowSize END (OK)");
336 Assert.Pass("Caught ArgumentNullException : Passed!");
342 [Description("Window SetPosition")]
343 [Property("SPEC", "Tizen.NUI.Window.SetPosition M")]
344 [Property("SPEC_URL", "-")]
345 [Property("CRITERIA", "MR")]
346 public void WindowSetPosition()
348 tlog.Debug(tag, $"WindowSetPosition START");
352 Position2D p1 = null;
353 myWin.SetPosition(p1);
355 catch (ArgumentNullException e)
357 tlog.Debug(tag, e.Message.ToString());
358 tlog.Debug(tag, $"WindowSetPosition END (OK)");
359 Assert.Pass("Caught ArgumentNullException : Passed!");
365 [Description("Window SetPositionSize")]
366 [Property("SPEC", "Tizen.NUI.Window.SetPositionSize M")]
367 [Property("SPEC_URL", "-")]
368 [Property("CRITERIA", "MR")]
369 public void WindowSetPositionSize()
371 tlog.Debug(tag, $"WindowSetPositionSize START");
374 Rectangle r1 = new Rectangle(0, 0, 20, 20);
375 myWin.SetPositionSize(r1);
379 tlog.Debug(tag, e.Message.ToString());
380 Assert.Fail("Caught Exception : Failed!");
382 tlog.Debug(tag, $"WindowSetPositionSize END (OK)");
387 [Description("Window AddFrameUpdateCallback")]
388 [Property("SPEC", "Tizen.NUI.Window.AddFrameUpdateCallback M")]
389 [Property("SPEC_URL", "-")]
390 [Property("CRITERIA", "MR")]
391 public void WindowAddFrameUpdateCallback()
393 tlog.Debug(tag, $"WindowAddFrameUpdateCallback START");
396 FrameUpdateCallbackInterface f1 = new FrameUpdateCallbackInterface();
397 myWin.AddFrameUpdateCallback(f1);
401 tlog.Debug(tag, e.Message.ToString());
402 Assert.Fail("Caught Exception : Failed!");
405 tlog.Debug(tag, $"WindowAddFrameUpdateCallback END (OK)");
410 [Description("Window RemoveFrameUpdateCallback")]
411 [Property("SPEC", "Tizen.NUI.Window.RemoveFrameUpdateCallback M")]
412 [Property("SPEC_URL", "-")]
413 [Property("CRITERIA", "MR")]
414 public void WindowRemoveFrameUpdateCallback()
416 tlog.Debug(tag, $"WindowRemoveFrameUpdateCallback START");
419 FrameUpdateCallbackInterface f1 = new FrameUpdateCallbackInterface();
420 myWin.RemoveFrameUpdateCallback(f1);
424 tlog.Debug(tag, e.Message.ToString());
425 Assert.Fail("Caught Exception : Failed!");
428 tlog.Debug(tag, $"WindowRemoveFrameUpdateCallback END (OK)");
433 [Description("Window AddFrameRenderedCallback")]
434 [Property("SPEC", "Tizen.NUI.Window.AddFrameRenderedCallback M")]
435 [Property("SPEC_URL", "-")]
436 [Property("CRITERIA", "MR")]
437 public void WindowAddFrameRenderedCallback()
439 tlog.Debug(tag, $"WindowAddFrameRenderedCallback START");
443 FrameCallbackType f1 = null;
444 myWin.AddFrameRenderedCallback(f1, 1);
446 catch (ArgumentNullException e)
448 tlog.Debug(tag, e.Message.ToString());
449 tlog.Debug(tag, $"WindowAddFrameRenderedCallback END (OK)");
450 Assert.Pass("Caught ArgumentNullException : Passed!");
456 [Description("Window AddFramePresentedCallback")]
457 [Property("SPEC", "Tizen.NUI.Window.AddFramePresentedCallback M")]
458 [Property("SPEC_URL", "-")]
459 [Property("CRITERIA", "MR")]
460 public void WindowAddFramePresentedCallback()
462 tlog.Debug(tag, $"WindowAddFramePresentedCallback START");
466 FrameCallbackType f1 = null;
467 myWin.AddFramePresentedCallback(f1, 1);
469 catch (ArgumentNullException e)
471 tlog.Debug(tag, e.Message.ToString());
472 tlog.Debug(tag, $"WindowAddFramePresentedCallback END (OK)");
473 Assert.Pass("Caught ArgumentNullException : Passed!");