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 Window myWin = null;
16 private Rectangle rec = null;
21 rec = new Rectangle(0, 0, 2, 2);
22 myWin = new Window(rec);
23 tlog.Info(tag, "Init() is called!");
35 tlog.Info(tag, "Destroy() is called!");
40 [Description("Window WindowPositionSize")]
41 [Property("SPEC", "Tizen.NUI.Window.WindowPositionSize A")]
42 [Property("SPEC_URL", "-")]
43 [Property("CRITERIA", "PRW")]
44 public void WindowWindowPositionSize()
46 tlog.Debug(tag, $"WindowWindowPositionSize START");
50 myWin.WindowPositionSize = new Rectangle(1, 2, 3, 4);
54 tlog.Debug(tag, e.Message.ToString());
55 Assert.Fail("Caught Exception : Failed!");
58 tlog.Debug(tag, $"WindowWindowPositionSize END (OK)");
63 //[Description("Window DEFAULT_BACKGROUND_COLOR")]
64 //[Property("SPEC", "Tizen.NUI.Window.DEFAULT_BACKGROUND_COLOR A")]
65 //[Property("SPEC_URL", "-")]
66 //[Property("CRITERIA", "PRW")]
67 //public void WindowDEFAULT_BACKGROUND_COLOR()
69 // tlog.Debug(tag, $"WindowDEFAULT_BACKGROUND_COLOR START");
72 // Vector4 v1 = Window.DEFAULT_BACKGROUND_COLOR;
74 // catch (Exception e)
76 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
78 // Assert.Fail("Caught Exception" + e.ToString());
80 // tlog.Debug(tag, $"WindowDEFAULT_BACKGROUND_COLOR END (OK)");
81 // Assert.Pass("WindowDEFAULT_BACKGROUND_COLOR");
86 //[Description("Window DEBUG_BACKGROUND_COLOR")]
87 //[Property("SPEC", "Tizen.NUI.Window.DEBUG_BACKGROUND_COLOR A")]
88 //[Property("SPEC_URL", "-")]
89 //[Property("CRITERIA", "PRW")]
90 //public void WindowDEBUG_BACKGROUND_COLOR()
92 // tlog.Debug(tag, $"WindowDEBUG_BACKGROUND_COLOR START");
95 // Vector4 v1 = Window.DEBUG_BACKGROUND_COLOR;
97 // catch (Exception e)
99 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
101 // Assert.Fail("Caught Exception" + e.ToString());
103 // tlog.Debug(tag, $"WindowDEBUG_BACKGROUND_COLOR END (OK)");
104 // Assert.Pass("WindowDEBUG_BACKGROUND_COLOR");
109 [Description("Window GetLayer")]
110 [Property("SPEC", "Tizen.NUI.Window.GetLayer M")]
111 [Property("SPEC_URL", "-")]
112 [Property("CRITERIA", "MR")]
113 public void WindowGetLayer()
115 tlog.Debug(tag, $"WindowGetLayer START");
123 tlog.Debug(tag, e.Message.ToString());
124 Assert.Fail("Caught Exception : Failed!");
126 tlog.Debug(tag, $"WindowGetLayer END (OK)");
131 [Description("Window GetCurrentOrientation")]
132 [Property("SPEC", "Tizen.NUI.Window.GetCurrentOrientation M")]
133 [Property("SPEC_URL", "-")]
134 [Property("CRITERIA", "MR")]
135 public void WindowGetCurrentOrientation()
137 tlog.Debug(tag, $"WindowGetCurrentOrientation START");
141 myWin.GetCurrentOrientation();
145 tlog.Debug(tag, e.Message.ToString());
146 Assert.Fail("Caught Exception : Failed!");
149 tlog.Debug(tag, $"WindowGetCurrentOrientation END (OK)");
154 [Description("Window SetAvailableOrientations")]
155 [Property("SPEC", "Tizen.NUI.Window.SetAvailableOrientations M")]
156 [Property("SPEC_URL", "-")]
157 [Property("CRITERIA", "MR")]
158 public void WindowSetAvailableOrientations()
160 tlog.Debug(tag, $"WindowSetAvailableOrientations START");
163 List<Window.WindowOrientation> l1 = new List<Window.WindowOrientation>();
165 l1.Add(Window.WindowOrientation.Landscape);
166 l1.Add(Window.WindowOrientation.LandscapeInverse);
167 l1.Add(Window.WindowOrientation.NoOrientationPreference);
168 l1.Add(Window.WindowOrientation.Portrait);
169 l1.Add(Window.WindowOrientation.PortraitInverse);
171 myWin.SetAvailableOrientations(l1);
175 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
176 Assert.Fail("Caught Exception" + e.ToString());
179 tlog.Debug(tag, $"WindowSetAvailableOrientations END (OK)");
180 Assert.Pass("WindowSetAvailableOrientations");
185 [Description("Window GetNativeId")]
186 [Property("SPEC", "Tizen.NUI.Window.GetNativeId M")]
187 [Property("SPEC_URL", "-")]
188 [Property("CRITERIA", "MR")]
189 public void WindowGetNativeId()
191 tlog.Debug(tag, $"WindowGetNativeId START");
199 tlog.Debug(tag, e.Message.ToString());
200 Assert.Fail("Caught Exception : Failed!");
203 tlog.Debug(tag, $"WindowGetNativeId END (OK)");
208 [Description("Window GetNativeHandle")]
209 [Property("SPEC", "Tizen.NUI.Window.GetNativeHandle M")]
210 [Property("SPEC_URL", "-")]
211 [Property("CRITERIA", "MR")]
212 public void WindowGetNativeHandle()
214 tlog.Debug(tag, $"WindowGetNativeHandle START");
218 myWin.GetNativeHandle();
222 tlog.Debug(tag, e.Message.ToString());
223 Assert.Fail("Caught Exception : Failed!");
226 tlog.Debug(tag, $"WindowGetNativeHandle END (OK)");
231 [Description("Window Add")]
232 [Property("SPEC", "Tizen.NUI.Window.Add M")]
233 [Property("SPEC_URL", "-")]
234 [Property("CRITERIA", "MR")]
235 public void WindowAdd()
237 tlog.Debug(tag, $"WindowAdd START");
244 catch (ArgumentNullException e)
246 tlog.Debug(tag, e.Message.ToString());
247 tlog.Debug(tag, $"WindowAdd END (OK)");
248 Assert.Pass("Caught ArgumentNullException : Passed!");
254 [Description("Window Remove")]
255 [Property("SPEC", "Tizen.NUI.Window.Remove M")]
256 [Property("SPEC_URL", "-")]
257 [Property("CRITERIA", "MR")]
258 public void WindowRemove()
260 tlog.Debug(tag, $"WindowRemove START");
267 catch (ArgumentNullException e)
269 tlog.Debug(tag, e.Message.ToString());
270 tlog.Debug(tag, $"WindowRemove END (OK)");
271 Assert.Pass("Caught ArgumentNullException : Passed!");
277 [Description("Window GetRenderTaskList")]
278 [Property("SPEC", "Tizen.NUI.Window.GetRenderTaskList M")]
279 [Property("SPEC_URL", "-")]
280 [Property("CRITERIA", "MR")]
281 public void WindowGetRenderTaskList()
283 tlog.Debug(tag, $"WindowGetRenderTaskList START");
286 myWin.GetRenderTaskList();
290 tlog.Debug(tag, e.Message.ToString());
291 Assert.Fail("Caught Exception : Failed!");
294 tlog.Debug(tag, $"WindowGetRenderTaskList END (OK)");
299 //[Description("Window GetObjectRegistry")]
300 //[Property("SPEC", "Tizen.NUI.Window.GetObjectRegistry M")]
301 //[Property("SPEC_URL", "-")]
302 //[Property("CRITERIA", "MR")]
303 //public void WindowGetObjectRegistry()
305 // tlog.Debug(tag, $"WindowGetObjectRegistry START");
308 // myWin.GetObjectRegistry();
310 // catch (Exception e)
312 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
314 // Assert.Fail("Caught Exception" + e.ToString());
316 // tlog.Debug(tag, $"WindowGetObjectRegistry END (OK)");
317 // Assert.Pass("WindowGetObjectRegistry");
322 [Description("Window SetWindowSize")]
323 [Property("SPEC", "Tizen.NUI.Window.SetWindowSize M")]
324 [Property("SPEC_URL", "-")]
325 [Property("CRITERIA", "MR")]
326 public void WindowSetWindowSize()
328 tlog.Debug(tag, $"WindowSetWindowSize START");
333 myWin.SetWindowSize(s1);
335 catch (ArgumentNullException e)
337 tlog.Debug(tag, e.Message.ToString());
338 tlog.Debug(tag, $"WindowSetWindowSize END (OK)");
339 Assert.Pass("Caught ArgumentNullException : Passed!");
345 [Description("Window SetPosition")]
346 [Property("SPEC", "Tizen.NUI.Window.SetPosition M")]
347 [Property("SPEC_URL", "-")]
348 [Property("CRITERIA", "MR")]
349 public void WindowSetPosition()
351 tlog.Debug(tag, $"WindowSetPosition START");
355 Position2D p1 = null;
356 myWin.SetPosition(p1);
358 catch (ArgumentNullException e)
360 tlog.Debug(tag, e.Message.ToString());
361 tlog.Debug(tag, $"WindowSetPosition END (OK)");
362 Assert.Pass("Caught ArgumentNullException : Passed!");
368 [Description("Window SetPositionSize")]
369 [Property("SPEC", "Tizen.NUI.Window.SetPositionSize M")]
370 [Property("SPEC_URL", "-")]
371 [Property("CRITERIA", "MR")]
372 public void WindowSetPositionSize()
374 tlog.Debug(tag, $"WindowSetPositionSize START");
377 Rectangle r1 = new Rectangle(0, 0, 20, 20);
378 myWin.SetPositionSize(r1);
382 tlog.Debug(tag, e.Message.ToString());
383 Assert.Fail("Caught Exception : Failed!");
385 tlog.Debug(tag, $"WindowSetPositionSize END (OK)");
390 [Description("Window AddFrameUpdateCallback")]
391 [Property("SPEC", "Tizen.NUI.Window.AddFrameUpdateCallback M")]
392 [Property("SPEC_URL", "-")]
393 [Property("CRITERIA", "MR")]
394 public void WindowAddFrameUpdateCallback()
396 tlog.Debug(tag, $"WindowAddFrameUpdateCallback START");
399 FrameUpdateCallbackInterface f1 = new FrameUpdateCallbackInterface();
400 myWin.AddFrameUpdateCallback(f1);
404 tlog.Debug(tag, e.Message.ToString());
405 Assert.Fail("Caught Exception : Failed!");
408 tlog.Debug(tag, $"WindowAddFrameUpdateCallback END (OK)");
413 [Description("Window RemoveFrameUpdateCallback")]
414 [Property("SPEC", "Tizen.NUI.Window.RemoveFrameUpdateCallback M")]
415 [Property("SPEC_URL", "-")]
416 [Property("CRITERIA", "MR")]
417 public void WindowRemoveFrameUpdateCallback()
419 tlog.Debug(tag, $"WindowRemoveFrameUpdateCallback START");
422 FrameUpdateCallbackInterface f1 = new FrameUpdateCallbackInterface();
423 myWin.RemoveFrameUpdateCallback(f1);
427 tlog.Debug(tag, e.Message.ToString());
428 Assert.Fail("Caught Exception : Failed!");
431 tlog.Debug(tag, $"WindowRemoveFrameUpdateCallback END (OK)");
436 [Description("Window AddFrameRenderedCallback")]
437 [Property("SPEC", "Tizen.NUI.Window.AddFrameRenderedCallback M")]
438 [Property("SPEC_URL", "-")]
439 [Property("CRITERIA", "MR")]
440 public void WindowAddFrameRenderedCallback()
442 tlog.Debug(tag, $"WindowAddFrameRenderedCallback START");
446 FrameCallbackType f1 = null;
447 myWin.AddFrameRenderedCallback(f1, 1);
449 catch (ArgumentNullException e)
451 tlog.Debug(tag, e.Message.ToString());
452 tlog.Debug(tag, $"WindowAddFrameRenderedCallback END (OK)");
453 Assert.Pass("Caught ArgumentNullException : Passed!");
459 [Description("Window AddFramePresentedCallback")]
460 [Property("SPEC", "Tizen.NUI.Window.AddFramePresentedCallback M")]
461 [Property("SPEC_URL", "-")]
462 [Property("CRITERIA", "MR")]
463 public void WindowAddFramePresentedCallback()
465 tlog.Debug(tag, $"WindowAddFramePresentedCallback START");
469 FrameCallbackType f1 = null;
470 myWin.AddFramePresentedCallback(f1, 1);
472 catch (ArgumentNullException e)
474 tlog.Debug(tag, e.Message.ToString());
475 tlog.Debug(tag, $"WindowAddFramePresentedCallback END (OK)");
476 Assert.Pass("Caught ArgumentNullException : Passed!");