using NUnit.Framework;
+using System;
using System.Collections.Generic;
namespace Tizen.NUI.Devel.Tests
[Test]
[Category("P1")]
- [Description("Create a GLWindow object.")]
+ [Description("GLWindow constructor.")]
[Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "CONSTR")]
public void GLWindowConstructor()
{
tlog.Debug(tag, $"GLWindowConstructor START");
+
+ var testingTarget = new GLWindow();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<GLWindow>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Destroy();
+ tlog.Debug(tag, $"GLWindowConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GLWindow constructor. With name.")]
+ [Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ public void GLWindowConstructorWithName()
+ {
+ tlog.Debug(tag, $"GLWindowConstructorWithName START");
+
string name = "myGLWindow";
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
- GLWindow a2 = new GLWindow();
- GLWindow a3 = new GLWindow(GLWindow.getCPtr(a1).Handle, true);
-
a1.Destroy();
- a2.Destroy();
- a3.Destroy();
- tlog.Debug(tag, $"GLWindowConstructor END (OK)");
- Assert.Pass("GLWindowConstructor");
+ tlog.Debug(tag, $"GLWindowConstructorWithName END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GLWindow constructor. With GLWindow.")]
+ [Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ public void GLWindowConstructorWithGLWindow()
+ {
+ tlog.Debug(tag, $"GLWindowConstructorWithGLWindow START");
+
+ using (GLWindow glwindow = new GLWindow())
+ {
+ var testingTarget = new GLWindow(glwindow.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<GLWindow>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Destroy();
+ }
+
+ tlog.Debug(tag, $"GLWindowConstructorWithGLWindow END (OK)");
}
[Test]
public void GLWindowWindowSize()
{
tlog.Debug(tag, $"GLWindowWindowSize START");
- string name = "myGLWindow";
- Rectangle rectangle = new Rectangle(20, 20, 100, 100);
- GLWindow a1 = new GLWindow(name, rectangle, true);
- Size2D b1 = a1.WindowSize;
- a1.WindowSize = b1;
- a1.WindowSize = null;
+ var testingTarget = new GLWindow();
+ Assert.IsNotNull(testingTarget, "Can't create success object GLWindow");
+ Assert.IsInstanceOf<GLWindow>(testingTarget, "Should be an instance of GLWindow type.");
- a1.Destroy();
+ testingTarget.WindowSize = new Size2D(50, 30);
+ Assert.AreEqual(50, testingTarget.WindowSize.Width, "Should be equal!");
+ Assert.AreEqual(30, testingTarget.WindowSize.Height, "Should be equal!");
+
+ testingTarget.Destroy();
tlog.Debug(tag, $"GLWindowWindowSize END (OK)");
- Assert.Pass("GLWindowWindowSize");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("GLWindow WindowSize")]
+ [Property("SPEC", "Tizen.NUI.GLWindow.WindowSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ public void GLWindowWindowSizeNullValue()
+ {
+ tlog.Debug(tag, $"GLWindowWindowSizeNullValue START");
+
+ var testingTarget = new GLWindow();
+ Assert.IsNotNull(testingTarget, "Can't create success object GLWindow");
+ Assert.IsInstanceOf<GLWindow>(testingTarget, "Should be an instance of GLWindow type.");
+
+ try
+ {
+ Size2D size2d = null;
+ testingTarget.WindowSize = size2d;
+ }
+ catch (ArgumentNullException)
+ {
+ testingTarget.Destroy();
+ tlog.Debug(tag, $"GLWindowWindowSizeNullValue END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
}
[Test]
public void GLWindowSetEglConfig()
{
tlog.Debug(tag, $"GLWindowSetEglConfig START");
- string name = "myGLWindow";
- Rectangle rectangle = new Rectangle(20, 20, 100, 100);
- GLWindow a1 = new GLWindow(name, rectangle, true);
- GLWindow.GLESVersion b1 = new GLWindow.GLESVersion();
- a1.SetEglConfig(true, true, 10, b1);
+ var testingTarget = new GLWindow();
+ Assert.IsNotNull(testingTarget, "Can't create success object GLWindow");
+ Assert.IsInstanceOf<GLWindow>(testingTarget, "Should be an instance of GLWindow type.");
- a1.Destroy();
+ try
+ {
+ testingTarget.SetEglConfig(true, true, 10, GLESVersion.Version20);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Destroy();
tlog.Debug(tag, $"GLWindowSetEglConfig END (OK)");
- Assert.Pass("GLWindowSetEglConfig");
}
[Test]
a1.Show();
a1.Destroy();
tlog.Debug(tag, $"GLWindowShow END (OK)");
- Assert.Pass("GLWindowShow");
}
[Test]
a1.Hide();
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowHide END (OK)");
- Assert.Pass("GLWindowHide");
}
a1.Raise();
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowRaise END (OK)");
- Assert.Pass("GLWindowRaise");
}
[Test]
a1.Lower();
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowLower END (OK)");
- Assert.Pass("GLWindowLower");
}
[Test]
a1.Activate();
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowActivate END (OK)");
- Assert.Pass("GLWindowActivate");
}
[Test]
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
- Rectangle b1 = a1.WindowPositionSize;
- a1.WindowPositionSize = b1;
+ a1.WindowPositionSize = new Rectangle(30, 40, 50, 60);
+ Assert.AreEqual(30, a1.WindowPositionSize.X, "Should be equal!");
+ Assert.AreEqual(40, a1.WindowPositionSize.Y, "Should be equal!");
+ Assert.AreEqual(50, a1.WindowPositionSize.Width, "Should be equal!");
+ Assert.AreEqual(60, a1.WindowPositionSize.Height, "Should be equal!");
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowWindowPositionSize END (OK)");
- Assert.Pass("GLWindowWindowPositionSize");
}
[Test]
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
- a1.GetSupportedAuxiliaryHintCount();
+ var result = a1.GetSupportedAuxiliaryHintCount();
+ tlog.Debug(tag, "SupportedAuxiliaryHintCount : " + result);
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHintCount END (OK)");
- Assert.Pass("GLWindowGetSupportedAuxiliaryHintCount");
}
[Test]
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
- a1.GetSupportedAuxiliaryHint(1);
+ var result = a1.GetSupportedAuxiliaryHint(1);
+ tlog.Debug(tag, "GetSupportedAuxiliaryHint : " + result);
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHint END (OK)");
- Assert.Pass("GLWindowGetSupportedAuxiliaryHint");
}
[Test]
a1.AddAuxiliaryHint("myHint", "myValue");
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowAddAuxiliaryHint END (OK)");
- Assert.Pass("GLWindowAddAuxiliaryHint");
}
[Test]
uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
a1.RemoveAuxiliaryHint(pos);
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowRemoveAuxiliaryHint END (OK)");
- Assert.Pass("GLWindowRemoveAuxiliaryHint");
}
[Test]
uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
a1.SetAuxiliaryHintValue(pos, "myValue");
-
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowSetAuxiliaryHintValue END (OK)");
- Assert.Pass("GLWindowSetAuxiliaryHintValue");
}
[Test]
uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
a1.GetAuxiliaryHintValue(pos);
-
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowGetAuxiliaryHintValue END (OK)");
- Assert.Pass("GLWindowGetAuxiliaryHintValue");
}
[Test]
uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
a1.GetAuxiliaryHintId("myHint");
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId END (OK)");
- Assert.Pass("GLWindowGetAuxiliaryHintId");
}
[Test]
GLWindow a1 = new GLWindow(name, rectangle, true);
a1.SetInputRegion(rectangle);
+
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId END (OK)");
- Assert.Pass("GLWindowGetAuxiliaryHintId");
}
[Test]
GLWindow a1 = new GLWindow(name, rectangle, true);
a1.SetOpaqueState(true);
+
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowSetOpaqueState END (OK)");
- Assert.Pass("GLWindowSetOpaqueState");
}
[Test]
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
- a1.IsOpaqueState();
+ var result = a1.IsOpaqueState();
+ tlog.Debug(tag, "IsOpaqueState : " + result);
+
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowIsOpaqueState END (OK)");
- Assert.Pass("GLWindowIsOpaqueState");
}
[Test]
GLWindow.GLWindowOrientation o1 = new GLWindow.GLWindowOrientation();
a1.SetPreferredOrientation(o1);
+
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowSetPreferredOrientation END (OK)");
- Assert.Pass("GLWindowSetPreferredOrientation");
}
[Test]
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
+ var result = a1.GetCurrentOrientation();
+ tlog.Debug(tag, "CurrentOrientation : " + result);
- a1.GetCurrentOrientation();
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowGetCurrentOrientation END (OK)");
- Assert.Pass("GLWindowGetCurrentOrientation");
}
[Test]
a1.SetAvailableOrientations(l1);
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowSetAvailableOrientations END (OK)");
- Assert.Pass("GLWindowSetAvailableOrientations");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("GLWindow SetAvailableOrientations")]
+ [Property("SPEC", "Tizen.NUI.GLWindow.SetAvailableOrientations M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void GLWindowSetAvailableOrientationsNullValue()
+ {
+ tlog.Debug(tag, $"GLWindowSetAvailableOrientationsNullValue START");
+
+ string name = "myGLWindow";
+ Rectangle rectangle = new Rectangle(20, 20, 100, 100);
+ var testingTarget = new GLWindow(name, rectangle, true);
+
+ try
+ {
+ List<GLWindow.GLWindowOrientation> list = null;
+ testingTarget.SetAvailableOrientations(list);
+ }
+ catch (ArgumentNullException)
+ {
+ testingTarget.Destroy();
+ tlog.Debug(tag, $"GLWindowSetAvailableOrientationsNullValue END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
}
[Test]
GLWindow a1 = new GLWindow(name, rectangle, true);
a1.RenderOnce();
+
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowRenderOnce END (OK)");
- Assert.Pass("GLWindowRenderOnce");
}
[Test]
Rectangle rectangle = new Rectangle(20, 20, 100, 100);
GLWindow a1 = new GLWindow(name, rectangle, true);
+ a1.RegisterGlCallback(GLInit, GLRenderFrame, GLTerminate);
- a1.RegisterGlCallback(b1, c1, d1);
+ a1.Destroy();
tlog.Debug(tag, $"GLWindowRegisterGlCallback END (OK)");
- Assert.Pass("GLWindowRegisterGlCallback");
}
- public void b1() { }
- public int c1() { return 0; }
- public void d1() { }
-
[Test]
[Category("P1")]
- [Description("GLWindow Destroy")]
- [Property("SPEC", "Tizen.NUI.GLWindow.Destroy M")]
+ [Description("GLWindow RenderingMode")]
+ [Property("SPEC", "Tizen.NUI.GLWindow.RenderingMode A")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void GLWindowDestroy()
+ [Property("CRITERIA", "PRW")]
+ public void GLWindowRenderingMode()
{
- tlog.Debug(tag, $"GLWindowDestroy START");
- string name = "myGLWindow";
- Rectangle rectangle = new Rectangle(20, 20, 100, 100);
- GLWindow a1 = new GLWindow(name, rectangle, true);
+ tlog.Debug(tag, $"GLWindowRenderingMode START");
- a1.Destroy();
- tlog.Debug(tag, $"GLWindowDestroy END (OK)");
- Assert.Pass("GLWindowDestroy");
+ var testingTarget = new GLWindow();
+ Assert.IsNotNull(testingTarget, "Can't create success object GLWindow");
+ Assert.IsInstanceOf<GLWindow>(testingTarget, "Should be an instance of GLWindow type.");
+
+ testingTarget.RenderingMode = GLRenderingMode.Continuous;
+ tlog.Debug(tag, "RenderingMode : " + testingTarget.RenderingMode);
+
+ testingTarget.Destroy();
+ tlog.Debug(tag, $"GLWindowRenderingMode END (OK)");
}
+
+ public void GLInit() { }
+ public int GLRenderFrame() { return 0; }
+ public void GLTerminate() { }
}
}