return false;
}
+ private bool OnInterceptTouchEvent(object source, View.TouchEventArgs e)
+ {
+ return false;
+ }
+
[SetUp]
public void Init()
{
tlog.Debug(tag, $"InterceptTouchSignalConstructor END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("InterceptTouchSignal Empty.")]
- //[Property("SPEC", "Tizen.NUI.InterceptTouchSignal.Empty M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void InterceptTouchSignalEmpty()
- //{
- // tlog.Debug(tag, $"InterceptTouchSignalEmpty START");
-
- // var testingTarget = new InterceptTouchSignal();
- // Assert.IsNotNull(testingTarget, "Should be not null!");
- // Assert.IsInstanceOf<InterceptTouchSignal>(testingTarget, "Should be an Instance of InterceptTouchSignal!");
-
- // try
- // {
- // testingTarget.Empty();
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception: Failed!");
- // }
-
- // testingTarget.Dispose();
-
- // tlog.Debug(tag, $"InterceptTouchSignalEmpty END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("InterceptTouchSignal GetConnectionCount.")]
- //[Property("SPEC", "Tizen.NUI.InterceptTouchSignal.GetConnectionCount M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void InterceptTouchSignalGetConnectionCount()
- //{
- // tlog.Debug(tag, $"InterceptTouchSignalGetConnectionCount START");
-
- // var testingTarget = new InterceptTouchSignal();
- // Assert.IsNotNull(testingTarget, "Should be not null!");
- // Assert.IsInstanceOf<InterceptTouchSignal>(testingTarget, "Should be an Instance of InterceptTouchSignal!");
-
- // try
- // {
- // testingTarget.GetConnectionCount();
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception: Failed!");
- // }
-
- // testingTarget.Dispose();
-
- // tlog.Debug(tag, $"InterceptTouchSignalGetConnectionCount END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("InterceptTouchSignal Connect.")]
- //[Property("SPEC", "Tizen.NUI.InterceptTouchSignal.Connect M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void InterceptTouchSignalConnect()
- //{
- // tlog.Debug(tag, $"InterceptTouchSignalConnect START");
-
- // var testingTarget = new InterceptTouchSignal();
- // Assert.IsNotNull(testingTarget, "Should be not null!");
- // Assert.IsInstanceOf<InterceptTouchSignal>(testingTarget, "Should be an Instance of InterceptTouchSignal!");
-
- // try
- // {
- // dummyCallback callback = OnDummyCallback;
- // testingTarget.Connect(callback);
- // testingTarget.Disconnect(callback);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception: Failed!");
- // }
-
- // testingTarget.Dispose();
-
- // tlog.Debug(tag, $"InterceptTouchSignalConnect END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("InterceptTouchSignal Emit.")]
- //[Property("SPEC", "Tizen.NUI.InterceptTouchSignal.Emit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //[Obsolete]
- //public void InterceptTouchSignalEmit()
- //{
- // tlog.Debug(tag, $"InterceptTouchSignalEmit START");
- // var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
- // var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
-
- // tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
-
- // var testingTarget = new InterceptTouchSignal();
- // Assert.IsNotNull(testingTarget, "Should be not null!");
- // Assert.IsInstanceOf<InterceptTouchSignal>(testingTarget, "Should be an Instance of InterceptTouchSignal!");
-
- // try
- // {
- // using (Touch touch = new Touch())
- // {
- // testingTarget.Emit(touch);
- // }
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception: Failed!");
- // }
-
- // testingTarget.Dispose();
-
- // tlog.Debug(tag, $"InterceptTouchSignalEmit END (OK)");
- //}
+ [Test]
+ [Category("P1")]
+ [Description("InterceptTouchSignal Empty.")]
+ [Property("SPEC", "Tizen.NUI.InterceptTouchSignal.Empty M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void InterceptTouchSignalEmpty()
+ {
+ tlog.Debug(tag, $"InterceptTouchSignalEmpty START");
+
+ using (View view = new View())
+ {
+ var testingTarget = new InterceptTouchSignal(view.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<InterceptTouchSignal>(testingTarget, "Should be an Instance of InterceptTouchSignal!");
+
+ try
+ {
+ testingTarget.Empty();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"InterceptTouchSignalEmpty END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("InterceptTouchSignal GetConnectionCount.")]
+ [Property("SPEC", "Tizen.NUI.InterceptTouchSignal.GetConnectionCount M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void InterceptTouchSignalGetConnectionCount()
+ {
+ tlog.Debug(tag, $"InterceptTouchSignalGetConnectionCount START");
+
+ using (View view = new View())
+ {
+ var testingTarget = new InterceptTouchSignal(view.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<InterceptTouchSignal>(testingTarget, "Should be an Instance of InterceptTouchSignal!");
+
+ try
+ {
+ testingTarget.GetConnectionCount();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"InterceptTouchSignalGetConnectionCount END (OK)");
+ }
}
}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/Common/KeyInputFocusManager")]
+ public class InternalKeyInputFocusManagerTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("KeyInputFocusManager Get.")]
+ [Property("SPEC", "Tizen.NUI.KeyInputFocusManager.Get M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void KeyInputFocusManagerGet()
+ {
+ tlog.Debug(tag, $"KeyInputFocusManagerGet START");
+
+ var testingTarget = KeyInputFocusManager.Get();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<KeyInputFocusManager>(testingTarget, "Should be an Instance of KeyInputFocusManager!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"KeyInputFocusManagerGet END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("KeyInputFocusManager SetFocus.")]
+ [Property("SPEC", "Tizen.NUI.KeyInputFocusManager.SetFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void KeyInputFocusManagerSetFocus()
+ {
+ tlog.Debug(tag, $"KeyInputFocusManagerSetFocus START");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = KeyInputFocusManager.Get();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<KeyInputFocusManager>(testingTarget, "Should be an Instance of KeyInputFocusManager!");
+
+ testingTarget.SetFocus(view);
+ var result = testingTarget.GetCurrentFocusControl();
+ Assert.AreEqual(100, result.Size.Width, "Should be equal!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"KeyInputFocusManagerSetFocus END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("KeyInputFocusManager RemoveFocus.")]
+ [Property("SPEC", "Tizen.NUI.KeyInputFocusManager.RemoveFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void KeyInputFocusManagerRemoveFocus()
+ {
+ tlog.Debug(tag, $"KeyInputFocusManagerRemoveFocus START");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = KeyInputFocusManager.Get();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<KeyInputFocusManager>(testingTarget, "Should be an Instance of KeyInputFocusManager!");
+
+ testingTarget.SetFocus(view);
+
+ try
+ {
+ testingTarget.RemoveFocus(view);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"KeyInputFocusManagerRemoveFocus END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("KeyInputFocusManager KeyInputFocusChangedSignal.")]
+ [Property("SPEC", "Tizen.NUI.KeyInputFocusManager.KeyInputFocusChangedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void KeyInputFocusManagerKeyInputFocusChangedSignal()
+ {
+ tlog.Debug(tag, $"KeyInputFocusManagerKeyInputFocusChangedSignal START");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = KeyInputFocusManager.Get();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<KeyInputFocusManager>(testingTarget, "Should be an Instance of KeyInputFocusManager!");
+
+ testingTarget.SetFocus(view);
+ var signal = testingTarget.KeyInputFocusChangedSignal();
+ Assert.IsNotNull(signal, "Should be not null!");
+ Assert.IsInstanceOf<Tizen.NUI.SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__Control_Dali__Toolkit__ControlF_t>(signal, "Should be an Instance of Tizen.NUI.SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__Control_Dali__Toolkit__ControlF_t!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"KeyInputFocusManagerKeyInputFocusChangedSignal END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/Common/LinearConstrainer")]
+ public class InternalLinearConstrainerTest
+ {
+ private const string tag = "NUITEST";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "lottie.json";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer constructor")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.LinearConstrainer C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerConstructor()
+ {
+ tlog.Debug(tag, $"LinearConstrainerConstructor START");
+
+ var testingTarget = new LinearConstrainer();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ tlog.Debug(tag, "getCPtr : " + LinearConstrainer.getCPtr(testingTarget));
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearConstrainerConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer constructor")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.LinearConstrainer C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerConstructorWithLinearConstrainer()
+ {
+ tlog.Debug(tag, $"LinearConstrainerConstructorWithLinearConstrainer START");
+
+ using (LinearConstrainer constrainer = new LinearConstrainer())
+ {
+ var testingTarget = new LinearConstrainer(constrainer);
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget?.Dispose();
+ }
+
+ tlog.Debug(tag, $"LinearConstrainerConstructorWithLinearConstrainer END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer Property")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.Property A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerProperty()
+ {
+ tlog.Debug(tag, $"LinearConstrainerProperty START");
+
+ var result = LinearConstrainer.Property.VALUE;
+ tlog.Debug(tag, "VALUE : " + result);
+
+ result = LinearConstrainer.Property.PROGRESS;
+ tlog.Debug(tag, "PROGRESS : " + result);
+
+ tlog.Debug(tag, $"LinearConstrainerProperty END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer DownCast")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.DownCast M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerDownCast()
+ {
+ tlog.Debug(tag, $"LinearConstrainerDownCast START");
+
+ using (Builder builder = new Builder())
+ {
+ builder.LoadFromFile(path);
+ var testingTarget = builder.GetLinearConstrainer("Camera_003_render");
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ LinearConstrainer.DownCast(testingTarget);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"LinearConstrainerDownCast END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer Assign")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerAssign()
+ {
+ tlog.Debug(tag, $"LinearConstrainerAssign START");
+
+ using (Builder builder = new Builder())
+ {
+ builder.LoadFromFile(path);
+ var testingTarget = builder.GetLinearConstrainer("Camera_003_render");
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ using (LinearConstrainer constrainer = new LinearConstrainer())
+ {
+ testingTarget.Assign(constrainer);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"LinearConstrainerAssign END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer Remove")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.Remove M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerRemove()
+ {
+ tlog.Debug(tag, $"LinearConstrainerRemove START");
+
+ var testingTarget = new LinearConstrainer();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ using (Animatable ani = new Animatable())
+ {
+ testingTarget.Remove(ani);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearConstrainerRemove END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer Value")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.Value A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerValue()
+ {
+ tlog.Debug(tag, $"LinearConstrainerValue START");
+
+ var testingTarget = new LinearConstrainer();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ using (PropertyArray arr = new PropertyArray())
+ {
+ arr.PushBack(new PropertyValue(new Vector3(0.0f, 0.0f, 0.0f)));
+
+ testingTarget.Value = arr;
+ tlog.Debug(tag, "Value : " + testingTarget.Value);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearConstrainerValue END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearConstrainer Progress")]
+ [Property("SPEC", "Tizen.NUI.LinearConstrainer.Progress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LinearConstrainerProgress()
+ {
+ tlog.Debug(tag, $"LinearConstrainerProgress START");
+
+ var testingTarget = new LinearConstrainer();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearConstrainer>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ using (PropertyArray arr = new PropertyArray())
+ {
+ arr.PushBack(new PropertyValue(0.3f));
+
+ testingTarget.Progress = arr;
+ tlog.Debug(tag, "Progress : " + testingTarget.Progress);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearConstrainerProgress END (OK)");
+ }
+ }
+}
public class InternalRenderTaskTest
{
private const string tag = "NUITEST";
+ private string arrowImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "arrow.png";
[SetUp]
public void Init()
tlog.Debug(tag, $"RenderTaskSetScreenToFrameBufferMappingView END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetViewportPosition.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetViewportPosition M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RenderTaskSetViewportPosition()
- //{
- // tlog.Debug(tag, $"RenderTaskSetViewportPosition START");
-
- // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50) })
- // {
- // var testingTarget = RenderTask.GetRenderTaskFromPtr(view.SwigCPtr.Handle);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
-
- // using (Vector2 postion = new Vector2(200, 100))
- // {
- // testingTarget.SetViewportPosition(postion);
- // var pos = testingTarget.GetCurrentViewportPosition();
- // tlog.Debug(tag, "ViewportPosition : " + pos);
- // }
-
- // testingTarget.Dispose();
- // }
+ [Test]
+ [Category("P1")]
+ [Description("RenderTask SetViewportPosition.")]
+ [Property("SPEC", "Tizen.NUI.RenderTask.SetViewportPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RenderTaskSetViewportPosition()
+ {
+ tlog.Debug(tag, $"RenderTaskSetViewportPosition START");
- // tlog.Debug(tag, $"RenderTaskSetViewportPosition END (OK)");
- //}
+ using (Animatable ani = new Animatable())
+ {
+ ani.RegisterProperty("ArrowImage", new PropertyValue(arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite);
+
+ var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetViewportSize.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetViewportSize M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RenderTaskSetViewportSize()
- //{
- // tlog.Debug(tag, $"RenderTaskSetViewportSize START");
+ try
+ {
+ testingTarget.SetViewportPosition(new Vector2(100, 50));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
- // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50) })
- // {
- // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
+ testingTarget.Dispose();
+ }
- // using (Vector2 size = new Vector2(200, 100))
- // {
- // testingTarget.SetViewportSize(size);
- // var result = testingTarget.GetCurrentViewportSize();
- // tlog.Debug(tag, "Current viewport Size : " + result);
- // }
+ tlog.Debug(tag, $"RenderTaskSetViewportPosition END (OK)");
+ }
- // testingTarget.Dispose();
- // }
+ [Test]
+ [Category("P1")]
+ [Description("RenderTask SetViewportSize.")]
+ [Property("SPEC", "Tizen.NUI.RenderTask.SetViewportSize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RenderTaskSetViewportSize()
+ {
+ tlog.Debug(tag, $"RenderTaskSetViewportSize START");
- // tlog.Debug(tag, $"RenderTaskSetViewportSize END (OK)");
- //}
+ using (Animatable ani = new Animatable())
+ {
+ ani.RegisterProperty("ArrowImage", new PropertyValue(arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite);
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetViewport.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetViewport M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RenderTaskSetViewport()
- //{
- // tlog.Debug(tag, $"RenderTaskSetViewport START");
+ var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50) })
- // {
- // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
+ try
+ {
+ testingTarget.SetViewportSize(new Vector2(50, 100));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
- // using (Rectangle viewport = new Rectangle(3, 5, 4, 6))
- // {
- // testingTarget.SetViewport(viewport);
- // var result = testingTarget.GetViewport();
- // tlog.Debug(tag, "Viewport : " + result);
- // }
+ testingTarget.Dispose();
+ }
- // testingTarget.Dispose();
- // }
+ tlog.Debug(tag, $"RenderTaskSetViewportSize END (OK)");
+ }
- // tlog.Debug(tag, $"RenderTaskSetViewport END (OK)");
- //}
+ [Test]
+ [Category("P1")]
+ [Description("RenderTask SetClearColor.")]
+ [Property("SPEC", "Tizen.NUI.RenderTask.SetClearColor M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void RenderTaskSetClearColor()
+ {
+ tlog.Debug(tag, $"RenderTaskSetClearColor START");
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetClearColor.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetClearColor M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //[Obsolete]
- //public void RenderTaskSetClearColor()
- //{
- // tlog.Debug(tag, $"RenderTaskSetClearColor START");
+ using (Animatable ani = new Animatable())
+ {
+ ani.RegisterProperty("ArrowImage", new PropertyValue(arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite);
- // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50), Color = Color.Cyan })
- // {
- // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
+ var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // using (Vector4 color = new Vector4(0.3f, 0.5f, 0.4f, 0.6f))
- // {
- // testingTarget.SetClearColor(color);
- // var result = testingTarget.GetClearColor();
- // tlog.Debug(tag, "ClearColor : " + result);
- // }
+ try
+ {
+ testingTarget.SetClearColor(new Vector4(1.0f, 1.0f, 1.0f, 1.0f));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
- // testingTarget.Dispose();
- // }
+ testingTarget.Dispose();
+ }
- // tlog.Debug(tag, $"RenderTaskSetClearColor END (OK)");
- //}
+ tlog.Debug(tag, $"RenderTaskSetClearColor END (OK)");
+ }
[Test]
[Category("P1")]
using NUnit.Framework.TUnit;
using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
namespace Tizen.NUI.Devel.Tests
{
private delegate float dummyAlphaFunctionDelegate(float progress);
private dummyAlphaFunctionDelegate alphaFunction;
- private float AlphaFunction(float progress)
+ private float callback(float progress)
{
return 1.0f;
}
{
tlog.Debug(tag, $"AlphaFunctionConstructorWithUserDefinedFunction START");
- alphaFunction = new dummyAlphaFunctionDelegate(AlphaFunction);
+ alphaFunction = new dummyAlphaFunctionDelegate(callback);
var testingTarget = new AlphaFunction(alphaFunction);
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<AlphaFunction>(testingTarget, "should be an instance of testing target class!");
+ tlog.Debug(tag, "getCPtr : " + AlphaFunction.getCPtr(testingTarget));
+
testingTarget.Dispose();
tlog.Debug(tag, $"AlphaFunctionConstructorWithUserDefinedFunction END (OK)");
}
testingTarget.Dispose();
tlog.Debug(tag, $"AlphaFunctionGetMode END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("AlphaFunction BuiltinToPropertyKey.")]
+ [Property("SPEC", "Tizen.NUI.AlphaFunction.BuiltinToPropertyKey M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AlphaFunctionBuiltinToPropertyKey()
+ {
+ tlog.Debug(tag, $"AlphaFunctionBuiltinToPropertyKey START");
+
+ PropertyValue pvAlpha = null;
+ string result = null;
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.Linear));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("LINEAR", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.Reverse));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("REVERSE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseInSquare));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_IN_SQUARE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseOutSquare));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_OUT_SQUARE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseIn));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_IN", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseOut));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_OUT", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseInOut));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_IN_OUT", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseInSine));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_IN_SINE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseOutSine));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_OUT_SINE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseInOutSine));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_IN_OUT_SINE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.Bounce));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("BOUNCE", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.Sin));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("SIN", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.EaseOutBack));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("EASE_OUT_BACK", result, "Should be equal!");
+
+ pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(AlphaFunction.BuiltinFunctions.Default));
+ pvAlpha.Get(out result);
+ Assert.AreEqual("DEFAULT", result, "Should be equal!");
+
+ result = null;
+ pvAlpha.Dispose();
+ tlog.Debug(tag, $"AlphaFunctionBuiltinToPropertyKey END (OK)");
+ }
}
}
testingTarget.Dispose();
tlog.Debug(tag, $"AnimatableRemovePropertyNotifications END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Animatable GetPropertyCount")]
+ [Property("SPEC", "Tizen.NUI.Animatable.GetPropertyCount M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimatableGetPropertyCount()
+ {
+ tlog.Debug(tag, $"AnimatableGetPropertyCount START");
+
+ var testingTarget = new Animatable();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animatable>(testingTarget, "should be an instance of Animatable class!");
+
+ tlog.Debug(tag, "PropertyCount : " + testingTarget.GetPropertyCount());
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimatableGetPropertyCount END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Animatable RemoveConstraints")]
+ [Property("SPEC", "Tizen.NUI.Animatable.RemoveConstraints M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimatableRemoveConstraints()
+ {
+ tlog.Debug(tag, $"AnimatableRemoveConstraints START");
+
+ var testingTarget = new Animatable();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animatable>(testingTarget, "should be an instance of Animatable class!");
+
+ try
+ {
+ testingTarget.RemoveConstraints();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimatableRemoveConstraints END (OK)");
+ }
}
}
{
private const string tag = "NUITEST";
+ private void OnFinished(object sender, EventArgs e)
+ {
+ tlog.Debug(tag, "OnFinished : Finished!");
+ }
+
+ private void OnProgressReached(object sender, EventArgs e)
+ {
+ tlog.Debug(tag, "OnProgressReached : ProgressReached!");
+ }
+
[SetUp]
public void Init()
{
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+ testingTarget.Finished += OnFinished;
+ testingTarget.Finished -= OnFinished;
+
+ testingTarget.ProgressReached += OnProgressReached;
+ testingTarget.ProgressReached -= OnProgressReached;
+
testingTarget.Dispose();
tlog.Debug(tag, $"AnimationConstructor END (OK)");
}
[Test]
[Category("P1")]
+ [Description("Animation DownCast")]
+ [Property("SPEC", "Tizen.NUI.Animation.DownCast M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationDownCast()
+ {
+ tlog.Debug(tag, $"AnimationDownCast START");
+
+ using (Animation ani = new Animation(300))
+ {
+ var testingTarget = Animation.DownCast(ani);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"AnimationDownCast END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Animation DownCast")]
+ [Property("SPEC", "Tizen.NUI.Animation.DownCast M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationDownCastWithNullHandle()
+ {
+ tlog.Debug(tag, $"AnimationDownCastWithNullHandle START");
+
+ BaseHandle handle = null;
+
+ try
+ {
+ Animation.DownCast(handle);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"AnimationDownCastWithNullHandle END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Animation Duration. Get")]
[Property("SPEC", "Tizen.NUI.Animation.Duration A")]
[Property("SPEC_URL", "-")]
Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
var result = testingTarget.Duration;
- Assert.AreEqual(2000, result, "should be eaqual.");
+ Assert.AreEqual(2000, result, "should be equal.");
testingTarget.Dispose();
tlog.Debug(tag, $"AnimationDurationGet END (OK)");
testingTarget.Duration = 2000;
var result = testingTarget.Duration;
- Assert.AreEqual(2000, result, "should be eaqual.");
+ Assert.AreEqual(2000, result, "should be equal.");
testingTarget.Dispose();
tlog.Debug(tag, $"AnimationDurationSet END (OK)");
Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
var result = testingTarget.State;
- Assert.AreEqual("Stopped", result.ToString(), "should be eaqual.");
+ Assert.AreEqual("Stopped", result.ToString(), "should be equal.");
testingTarget.Dispose();
tlog.Debug(tag, $"AnimationState END (OK)");
}
[Test]
+ [Category("P2")]
+ [Description("Animation AnimateBy")]
+ [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationAnimateByWithNullView()
+ {
+ tlog.Debug(tag, $"AnimationAnimateByWithNullView START");
+
+ View view = null;
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
+
+ try
+ {
+ testingTarget.AnimateBy(view, "Position", new Position(100, 150));
+ }
+ catch (ArgumentNullException)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationAnimateByWithNullView END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Animation AnimateBy")]
+ [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationAnimateByNullProperty()
+ {
+ tlog.Debug(tag, $"AnimationAnimateByNullProperty START");
+
+ View view = new View()
+ {
+ Position = new Position(0, 0)
+ };
+ Window.Instance.Add(view);
+ Assert.IsTrue(0 == view.Position.X);
+ Assert.IsTrue(0 == view.Position.Y);
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
+
+ try
+ {
+ string property = null;
+ testingTarget.AnimateBy(view, property, new Position(100, 150));
+ }
+ catch (ArgumentNullException)
+ {
+ Window.Instance.Remove(view);
+ view.Dispose();
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationAnimateByNullProperty END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Animation AnimateBy")]
+ [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationAnimateByNullObject()
+ {
+ tlog.Debug(tag, $"AnimationAnimateByNullObject START");
+
+ View view = new View()
+ {
+ Position = new Position(0, 0)
+ };
+ Window.Instance.Add(view);
+ Assert.IsTrue(0 == view.Position.X);
+ Assert.IsTrue(0 == view.Position.Y);
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
+
+ try
+ {
+ testingTarget.AnimateBy(view, "Position", null);
+ }
+ catch (ArgumentNullException)
+ {
+ Window.Instance.Remove(view);
+ view.Dispose();
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationAnimateByNullObject END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("Animation AnimateBy. With start time and end time")]
[Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
Position = new Position(0, 0)
};
Window.Instance.Add(view);
- Assert.AreEqual(0, view.Position.X, "sholud be eaqual.");
- Assert.AreEqual(0, view.Position.Y, "sholud be eaqual.");
+ Assert.AreEqual(0, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(0, view.Position.Y, "sholud be equal.");
var testingTarget = new Animation(1500);
Assert.IsNotNull(testingTarget, "should be not null");
testingTarget.AnimateBy(view, "Position", new Position(300, 200), 0, 300);
testingTarget.Play();
- Assert.AreEqual(400, view.Position.X, "sholud be eaqual.");
- Assert.AreEqual(350, view.Position.Y, "sholud be eaqual.");
+ Assert.AreEqual(400, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(350, view.Position.Y, "sholud be equal.");
view.Dispose();
testingTarget.Dispose();
}
[Test]
+ [Category("P2")]
+ [Description("Animation AnimateBy. With start time and end time")]
+ [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationAnimateByWithStartEndTimeAndNullView()
+ {
+ tlog.Debug(tag, $"AnimationAnimateByWithStartEndTimeAndNullView START");
+
+ View view = null;
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.EndAction = Animation.EndActions.StopFinal;
+ testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
+
+ try
+ {
+ testingTarget.AnimateBy(view, "Position", new Position(100, 150), 0, 300);
+ }
+ catch (ArgumentNullException)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationAnimateByWithStartEndTimeAndNullView END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Animation AnimateBy. With start time and end time")]
+ [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationAnimateByWithStartEndTimeAndNullString()
+ {
+ tlog.Debug(tag, $"AnimationAnimateByWithStartEndTimeAndNullString START");
+
+ var view = new View()
+ {
+ Position = new Position(0, 0)
+ };
+ Window.Instance.Add(view);
+ Assert.AreEqual(0, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(0, view.Position.Y, "sholud be equal.");
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.EndAction = Animation.EndActions.StopFinal;
+ testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
+
+ try
+ {
+ testingTarget.AnimateBy(view, null, new Position(100, 150), 0, 300);
+ }
+ catch (ArgumentNullException)
+ {
+ Window.Instance.Remove(view);
+ view.Dispose();
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationAnimateByWithStartEndTimeAndNullString END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Animation AnimateBy. With start time and end time")]
+ [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationAnimateByWithStartEndTimeAndNullObject()
+ {
+ tlog.Debug(tag, $"AnimationAnimateByWithStartEndTimeAndNullObject START");
+
+ var view = new View()
+ {
+ Position = new Position(0, 0)
+ };
+ Window.Instance.Add(view);
+ Assert.AreEqual(0, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(0, view.Position.Y, "sholud be equal.");
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.EndAction = Animation.EndActions.StopFinal;
+ testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
+
+ try
+ {
+ testingTarget.AnimateBy(view, "position", null, 0, 300);
+ }
+ catch (ArgumentNullException)
+ {
+ Window.Instance.Remove(view);
+ view.Dispose();
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationAnimateByWithStartEndTimeAndNullObject END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("Animation AnimateTo")]
[Property("SPEC", "Tizen.NUI.Animation.AnimateTo M")]
Position = new Position(0, 0)
};
Window.Instance.Add(view);
- Assert.AreEqual(0, view.Position.X, "sholud be eaqual.");
- Assert.AreEqual(0, view.Position.Y, "sholud be eaqual.");
+ Assert.AreEqual(0, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(0, view.Position.Y, "sholud be equal.");
var testingTarget = new Animation(1500);
Assert.IsNotNull(testingTarget, "should be not null");
testingTarget.AnimateTo(view, "Position", new Position(100, 150));
testingTarget.Play();
- Assert.AreEqual(100, view.Position.X, "sholud be eaqual.");
- Assert.AreEqual(150, view.Position.Y, "sholud be eaqual.");
+ Assert.AreEqual(100, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(150, view.Position.Y, "sholud be equal.");
view.Dispose();
testingTarget.Dispose();
Position = new Position(0, 0)
};
Window.Instance.Add(view);
- Assert.AreEqual(0, view.Position.X, "sholud be eaqual.");
- Assert.AreEqual(0, view.Position.Y, "sholud be eaqual.");
+ Assert.AreEqual(0, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(0, view.Position.Y, "sholud be equal.");
var testingTarget = new Animation(1500);
Assert.IsNotNull(testingTarget, "should be not null");
testingTarget.AnimateTo(view, "Position", new Position(300, 200), 0, 300);
testingTarget.Play();
- Assert.AreEqual(300, view.Position.X, "sholud be eaqual.");
- Assert.AreEqual(200, view.Position.Y, "sholud be eaqual.");
+ Assert.AreEqual(300, view.Position.X, "sholud be equal.");
+ Assert.AreEqual(200, view.Position.Y, "sholud be equal.");
view.Dispose();
testingTarget.Dispose();
}
[Test]
+ [Category("P2")]
+ [Description("Animation PlayAnimateTo")]
+ [Property("SPEC", "Tizen.NUI.Animation.PlayAnimateTo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationPlayAnimateToNullTarget()
+ {
+ tlog.Debug(tag, $"AnimationPlayAnimateToNullTarget START");
+
+ var testingTarget = new Animation(1500);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ TransitionAnimation transition = new TransitionAnimation(300);
+ ImageView view = null;
+
+ var dummy1 = new TransitionAnimationData()
+ {
+ Property = "Size",
+ DestinationValue = "100, 100",
+ StartTime = 300,
+ EndTime = 600
+ };
+ transition.AddAnimationData(dummy1);
+
+ var dummy2 = new TransitionAnimationData()
+ {
+ Property = "Position",
+ DestinationValue = "150, 250",
+ StartTime = 300,
+ EndTime = 600
+ };
+ transition.AddAnimationData(dummy2);
+
+ for (int i = 0; i < transition.AnimationDataList.Count; i++)
+ {
+ testingTarget.PropertyList.Add(transition.AnimationDataList[i].Property);
+ testingTarget.DestValueList.Add(transition.AnimationDataList[i].DestinationValue);
+ testingTarget.StartTimeList.Add(transition.AnimationDataList[i].StartTime);
+ testingTarget.EndTimeList.Add(transition.AnimationDataList[i].EndTime);
+ }
+
+ try
+ {
+ testingTarget.PlayAnimateTo(view);
+ }
+ catch (ArgumentNullException)
+ {
+ transition.Dispose();
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationPlayAnimateToNullTarget END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("Animation AnimateBetween")]
[Property("SPEC", "Tizen.NUI.Animation.AnimateBetween M")]
tlog.Debug(tag, $"AnimationClear END (OK)");
}
+ [Test]
+ [Category("P1")]
+ [Description("Animation Show")]
+ [Property("SPEC", "Tizen.NUI.Animation.Show M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void AnimationShow()
+ {
+ tlog.Debug(tag, $"AnimationShow START");
+
+ var testingTarget = new Animation(600);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
+
+ testingTarget.EndAction = Animation.EndActions.StopFinal;
+
+ using (View view = new View() { Color = Color.Cyan, })
+ {
+ testingTarget.Show(view, 200);
+ testingTarget.Hide(view, 300);
+ }
+
+ testingTarget.Play();
+ testingTarget.Stop();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"AnimationShow END (OK)");
+ }
+
//[Test]
//[Category("P1")]
//[Description("Animation Pause")]
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/BaseComponents/Style/Constants")]
+ public class PublicConstantsTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ControlStatesExtension FromControlStateClass.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlStatesExtension.FromControlStateClass M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ControlStatesExtensionFromControlStateClass()
+ {
+ tlog.Debug(tag, $"ControlStatesExtensionFromControlStateClass START");
+
+ var result = ControlStatesExtension.FromControlStateClass(ControlState.Normal);
+ Assert.AreEqual(ControlStates.Normal, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.Focused);
+ Assert.AreEqual(ControlStates.Focused, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.Disabled);
+ Assert.AreEqual(ControlStates.Disabled, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.Selected);
+ Assert.AreEqual(ControlStates.Selected, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.Pressed);
+ Assert.AreEqual(ControlStates.Pressed, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.DisabledFocused);
+ Assert.AreEqual(ControlStates.DisabledFocused, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.SelectedFocused);
+ Assert.AreEqual(ControlStates.SelectedFocused, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.DisabledSelected);
+ Assert.AreEqual(ControlStates.DisabledSelected, result, "Should be equal!");
+
+ result = ControlStatesExtension.FromControlStateClass(ControlState.All);
+ Assert.AreEqual(ControlStates.Normal, result, "Should be equal!");
+
+ tlog.Debug(tag, $"ControlStatesExtensionFromControlStateClass END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+
+namespace Tizen.NUI.Devel.Tests.testcase
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/BaseComponents/Style/Selector")]
+ public class PublicSelectorTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Selector Add.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorAddSelectorItem()
+ {
+ tlog.Debug(tag, $"SelectorAddSelectorItem START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ SelectorItem<Color> item = new SelectorItem<Color>();
+ item.Value = Color.White;
+ item.State = ControlState.All;
+
+ colors.Add(item);
+ // if item be added, remove if first
+ colors.Add(item);
+
+ colors.GetValue(ControlState.All, out Color color);
+ tlog.Debug(tag, "color : " + color);
+
+ tlog.Debug(tag, "Count :" + colors.Count);
+ tlog.Debug(tag, "IsReadOnly :" + colors.IsReadOnly);
+
+ var result = colors.Contains(item);
+ Assert.AreEqual(true, result, "Should be equal!");
+
+ try
+ {
+ colors.GetEnumerator();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ result = colors.Remove(item);
+ Assert.AreEqual(true, result, "Should be equal!");
+
+ tlog.Debug(tag, $"SelectorAddSelectorItem END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Selector Add.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorAddNullSelectorItem()
+ {
+ tlog.Debug(tag, $"SelectorAddNullSelectorItem START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ SelectorItem<Color> item = null;
+
+ try
+ {
+ colors.Add(item);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"SelectorAddNullSelectorItem END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Selector Contains.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.Contains M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorContainsNullSelectorItem()
+ {
+ tlog.Debug(tag, $"SelectorContainsNullSelectorItem START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ SelectorItem<Color> item = null;
+
+ try
+ {
+ colors.Contains(item);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"SelectorContainsNullSelectorItem END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("SelectorExtensions Add.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.SelectorExtensions.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorExtensionsAdd()
+ {
+ tlog.Debug(tag, $"SelectorExtensionsAdd START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ IList<SelectorItem<Color>> list = new List<SelectorItem<Color>>();
+
+ var item = new SelectorItem<Color>()
+ {
+ Value = Color.Cyan,
+ State = ControlState.All
+ };
+ item.ToString();
+ list.Add(item);
+
+ try
+ {
+ SelectorExtensions.Add(list, ControlState.All, Color.White);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"SelectorExtensionsAdd END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SelectorExtensions Add.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.SelectorExtensions.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorExtensionsAddWithNullList()
+ {
+ tlog.Debug(tag, $"SelectorExtensionsAddWithNullList START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ IList<SelectorItem<Color>> list = null;
+
+ try
+ {
+ SelectorExtensions.Add(list, ControlState.All, Color.White);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"SelectorExtensionsAddWithNullList END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Selector GetHashCode.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.GetHashCode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorGetHashCode()
+ {
+ tlog.Debug(tag, $"SelectorGetHashCode START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ SelectorItem<Color> item = new SelectorItem<Color>();
+ item.Value = Color.White;
+ item.State = ControlState.All;
+
+ colors.Add(item);
+ var result = colors.GetHashCode();
+ tlog.Debug(tag, "HashCode : " + result);
+
+ tlog.Debug(tag, $"SelectorGetHashCode END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Selector Equals.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.Equals M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorEquals()
+ {
+ tlog.Debug(tag, $"SelectorEquals START");
+
+ Selector<Color> colors = new Selector<Color>();
+
+ SelectorItem<Color> item = new SelectorItem<Color>();
+ item.Value = Color.White;
+ item.State = ControlState.All;
+
+ colors.Add(item);
+ Selector<Color> dummy1 = new Selector<Color>(Color.Cyan);
+ Selector<string> dummy2 = new Selector<string>("mytest");
+
+ var result = colors.Equals(dummy1);
+ tlog.Debug(tag, "Equals : " + result);
+
+ result = colors.Equals(dummy2);
+ tlog.Debug(tag, "Equals : " + result);
+
+ tlog.Debug(tag, $"SelectorEquals END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Selector ToString.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.ToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorToString()
+ {
+ tlog.Debug(tag, $"SelectorToString START");
+
+ var testingTarget = new Selector<Color>(Color.Cyan);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<Selector<Color>>(testingTarget, "Should return Selector<Color> instance.");
+
+ var result = testingTarget.ToString();
+ tlog.Debug(tag, "ToString : " + result);
+
+ tlog.Debug(tag, $"SelectorToString END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Selector CopyTo.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.CopyTo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorCopyTo()
+ {
+ tlog.Debug(tag, $"SelectorCopyTo START");
+
+ var testingTarget = new Selector<Color>(Color.Cyan);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<Selector<Color>>(testingTarget, "Should return Selector<Color> instance.");
+
+ SelectorItem<Color>[] item = new SelectorItem<Color>[2];
+ item[0] = new SelectorItem<Color>();
+ item[0].Value = Color.Cyan;
+ item[0].State = ControlState.All;
+
+ item[1] = new SelectorItem<Color>();
+ item[1].Value = Color.Yellow;
+ item[1].State = ControlState.Normal;
+
+ try
+ {
+ testingTarget.CopyTo(item, 0);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!" );
+ }
+
+ tlog.Debug(tag, $"SelectorCopyTo END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Selector GetValue.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector.GetValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SelectorGetValue()
+ {
+ tlog.Debug(tag, $"SelectorGetValue START");
+
+ var testingTarget = new Selector<Color>();
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<Selector<Color>>(testingTarget, "Should return Selector<Color> instance.");
+
+ SelectorItem<Color>[] item = new SelectorItem<Color>[2];
+ item[0] = new SelectorItem<Color>();
+ item[0].Value = Color.Cyan;
+ item[0].State = ControlState.All;
+
+ item[1] = new SelectorItem<Color>();
+ item[1].Value = Color.Yellow;
+ item[1].State = ControlState.Normal;
+
+ testingTarget.CopyTo(item, 0);
+ testingTarget.GetValue(ControlState.Normal, out Color color);
+ tlog.Debug(tag, "color : " + color);
+
+ tlog.Debug(tag, $"SelectorGetValue END (OK)");
+ }
+ }
+}
public class PublicCustomViewRegistryTest
{
private const string tag = "NUITEST";
- public static Func<CustomView> CreateInstance { get; private set; }
+ static CustomView CreateInstance()
+ {
+ return new Spin();
+ }
[SetUp]
public void Init()
}
[Test]
+ [Category("P1")]
+ [Description("CustomViewRegistry Register")]
+ [Property("SPEC", "Tizen.NUI.CustomViewRegistry.Register M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomViewRegistryRegister()
+ {
+ tlog.Debug(tag, $"CustomViewRegistryRegister START");
+
+ try
+ {
+ CustomViewRegistry.Instance.Register(CreateInstance, typeof(Spin));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"CustomViewRegistryRegister END (OK)");
+ }
+
+ [Test]
[Category("P2")]
[Description("CustomViewRegistry Register")]
[Property("SPEC", "Tizen.NUI.CustomViewRegistry.Register M")]
testingTarget.LongPressGesture = new LongPressGesture(Gesture.StateType.Possible);
Assert.AreEqual(Gesture.StateType.Possible, testingTarget.LongPressGesture.State, "Should be equal!");
+ tlog.Debug(tag, "Handled : " + testingTarget.Handled);
+
tlog.Debug(tag, $"LongPressGestureDetectedEventArgsView END (OK)");
}
}
}
private void OnDetected(object obj, PanGestureDetector.DetectedEventArgs e)
- { }
+ {
+ View view = e.View;
+ e.View = view;
+
+ PanGesture gesture = e.PanGesture;
+ e.PanGesture = gesture;
+
+ tlog.Debug(tag, "Handled : " + e.Handled);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DetectedEventArgs View.")]
+ [Property("SPEC", "Tizen.NUI.DetectedEventArgs.View A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LongPressGestureDetectedEventArgsView()
+ {
+ tlog.Debug(tag, $"PanGestureDetectedEventArgsView START");
+
+ var testingTarget = new Tizen.NUI.PanGestureDetector.DetectedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object DetectedEventArgs.");
+ Assert.IsInstanceOf<Tizen.NUI.PanGestureDetector.DetectedEventArgs>(testingTarget, "Should return DetectedEventArgs instance.");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ testingTarget.View = view;
+ Assert.AreEqual(100, testingTarget.View.Size.Width, "Should be equal!");
+ }
+
+ testingTarget.PanGesture = new PanGesture(Gesture.StateType.Possible);
+ Assert.AreEqual(Gesture.StateType.Possible, testingTarget.PanGesture.State, "Should be equal!");
+
+ tlog.Debug(tag, "Handled : " + testingTarget.Handled);
+
+ tlog.Debug(tag, $"PanGestureDetectedEventArgsView END (OK)");
+ }
}
}
testingTarget.PinchGesture = new PinchGesture(Gesture.StateType.Possible);
Assert.AreEqual(Gesture.StateType.Possible, testingTarget.PinchGesture.State, "Should be equal!");
+ tlog.Debug(tag, "Handled : " + testingTarget.Handled);
+
tlog.Debug(tag, $"PinchGestureDetectedEventArgsView END (OK)");
}
}
a1.Detected += OnDetected;
a1.Detected -= OnDetected;
-
- RotationGestureDetector.DetectedEventArgs e = new RotationGestureDetector.DetectedEventArgs();
- object o = new object();
-
- OnDetected(o, e);
-
+
a1.Dispose();
-
tlog.Debug(tag, $"RotationGestureDetectorDetected END (OK)");
- Assert.Pass("RotationGestureDetectorDetected");
}
private void OnDetected(object obj, RotationGestureDetector.DetectedEventArgs e)
- {
- View v1 = e.View;
- e.View = v1;
-
- RotationGesture p1 = e.RotationGesture;
- e.RotationGesture = p1;
- }
- }
+ { }
+
+ [Test]
+ [Category("P1")]
+ [Description("DetectedEventArgs View.")]
+ [Property("SPEC", "Tizen.NUI.DetectedEventArgs.View A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RotationGestureDetectedEventArgsView()
+ {
+ tlog.Debug(tag, $"RotationGestureDetectedEventArgsView START");
+ var testingTarget = new Tizen.NUI.RotationGestureDetector.DetectedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object DetectedEventArgs.");
+ Assert.IsInstanceOf<Tizen.NUI.RotationGestureDetector.DetectedEventArgs>(testingTarget, "Should return DetectedEventArgs instance.");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ testingTarget.View = view;
+ Assert.AreEqual(100, testingTarget.View.Size.Width, "Should be equal!");
+ }
+
+ testingTarget.RotationGesture = new RotationGesture(Gesture.StateType.Possible);
+ Assert.AreEqual(Gesture.StateType.Possible, testingTarget.RotationGesture.State, "Should be equal!");
+
+ tlog.Debug(tag, "Handled : " + testingTarget.Handled);
+
+ tlog.Debug(tag, $"RotationGestureDetectedEventArgsView END (OK)");
+ }
+ }
}
\ No newline at end of file
testingTarget.TapGesture = new TapGesture();
tlog.Debug(tag, "TapGesture : " + testingTarget.TapGesture);
+ tlog.Debug(tag, "Handled : " + testingTarget.Handled);
+
tlog.Debug(tag, $"TapGestureDetectedEventArgsView END (OK)");
}
}
{
tlog.Debug(tag, $"ImageLoadingGetOriginalImageSize START");
- var testingTarget = ImageLoading.GetOriginalImageSize(file_name, true);
+ var testingTarget = ImageLoading.GetOriginalImageSize(file_name);
Assert.IsNotNull(testingTarget, "Can't create success object Size2D.");
Assert.IsInstanceOf<Size2D>(testingTarget, "Should return Size2D instance.");
testingTarget.Dispose();
}
- tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithFittingMode END (OK)");
+ try
+ {
+ ImageLoading.DownloadImageSynchronously(bmp_path, null, FittingModeType.FitHeight);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithFittingMode END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
}
[Test]
testingTarget.Dispose();
}
- tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithSamplingMode END (OK)");
+ try
+ {
+ ImageLoading.DownloadImageSynchronously(bmp_path, null, FittingModeType.FitHeight, SamplingModeType.Nearest);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithSamplingMode END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
}
[Test]
testingTarget.Dispose();
}
- tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection END (OK)");
+ try
+ {
+ ImageLoading.DownloadImageSynchronously(bmp_path, null, FittingModeType.FitHeight, SamplingModeType.Nearest, true);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ImageLoading DownloadImageSynchronously. With Uri.")]
+ [Property("SPEC", "Tizen.NUI.ImageLoading.DownloadImageSynchronously M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ImageLoadingDownloadImageSynchronouslyByUrl()
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByUrl START");
+
+ using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
+ {
+ var testingTarget = ImageLoading.DownloadImageSynchronously(new Uri(bmp_path), size2d, FittingModeType.Center);
+ Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
+ Assert.IsInstanceOf<PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");
+
+ testingTarget.Dispose();
+ }
+
+ try
+ {
+ ImageLoading.DownloadImageSynchronously(new Uri(bmp_path), null, FittingModeType.FitHeight);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByUrl END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ImageLoading DownloadImageSynchronously. With Uri.")]
+ [Property("SPEC", "Tizen.NUI.ImageLoading.DownloadImageSynchronously M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ImageLoadingDownloadImageSynchronouslyByNullUrl()
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByNullUrl START");
+
+ try
+ {
+ using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
+ {
+ Uri uri = null;
+ ImageLoading.DownloadImageSynchronously(uri, size2d, FittingModeType.Center);
+ }
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByNullUrl END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
}
}
}
buffer = null;
testingTarget.Dispose();
+ // disposed
+ testingTarget.Dispose();
tlog.Debug(tag, $"ImageUrlDispose END (OK)");
}
}
[Test]
+ [Category("P2")]
+ [Description("FocusManager SetCurrentFocusView")]
+ [Property("SPEC", "Tizen.NUI.FocusManager.SetCurrentFocusView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FocusManagerSetCurrentFocusViewWithNull()
+ {
+ tlog.Debug(tag, $"FocusManagerSetCurrentFocusViewWithNull START");
+
+ var testingTarget = FocusManager.Instance;
+
+ try
+ {
+ View view = null;
+ testingTarget.SetCurrentFocusView(view);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, $"FocusManagerSetCurrentFocusViewWithNull END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed");
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("FocusManager GetCurrentFocusView")]
[Property("SPEC", "Tizen.NUI.FocusManager.GetCurrentFocusView M")]
public void FocusManagerGet()
{
tlog.Debug(tag, $"FocusManagerGet START");
- FocusManager a1 = FocusManager.Instance;
- FocusManager.Get();
+ try
+ {
+ FocusManager.Get();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
tlog.Debug(tag, $"FocusManagerGet END (OK)");
- Assert.Pass("FocusManagerGet");
}
}
}
internal class PublicKeyValueTest
{
private const string tag = "NUITEST";
-
+ private KeyValue keyValue = null;
+
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
+ keyValue = new KeyValue();
}
[TearDown]
public void Destroy()
{
+ keyValue.Dispose();
tlog.Info(tag, "Destroy() is called!");
}
public void KeyValueOriginalKey()
{
tlog.Debug(tag, $"KeyValueOriginalKey START");
- KeyValue a1 = new KeyValue();
- a1.OriginalKey = 10;
- a1.Dispose();
+ keyValue.OriginalKey = 10;
+
tlog.Debug(tag, $"KeyValueOriginalKey END (OK)");
- Assert.Pass("KeyValueOriginalKey");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("KeyValue OriginalKey")]
+ [Property("SPEC", "Tizen.NUI.KeyValue.OriginalKey A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void KeyValueOriginalKeyWithNull()
+ {
+ tlog.Debug(tag, $"KeyValueOriginalKeyWithNull START");
+
+ try
+ {
+ keyValue.OriginalKey = null;
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"KeyValueOriginalKeyWithNull END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
}
[Test]
public void KeyValueIntegerKey()
{
tlog.Debug(tag, $"KeyValueIntegerKey START");
- KeyValue a1 = new KeyValue
- {
- IntegerKey = 10
- };
+
+ keyValue.IntegerKey = 10;
+ tlog.Debug(tag, "IntegerKey : " + keyValue.IntegerKey);
- int? b1 = a1.IntegerKey;
-
- a1.Dispose();
tlog.Debug(tag, $"KeyValueIntegerKey END (OK)");
- Assert.Pass("KeyValueIntegerKey");
}
[Test]
public void KeyValueStringKey()
{
tlog.Debug(tag, $"KeyValueStringKey START");
- KeyValue a1 = new KeyValue
- {
- StringKey = "keyvalue"
- };
- string b1 = a1.StringKey;
+ keyValue.StringKey = "keyvalue";
+ tlog.Debug(tag, "IntegerKey : " + keyValue.StringKey);
- a1.Dispose();
tlog.Debug(tag, $"KeyValueStringKey END (OK)");
- Assert.Pass("KeyValueStringKey");
}
[Test]
{
tlog.Debug(tag, $"KeyValuePropertyValue START");
- PropertyValue p1 = new PropertyValue();
- KeyValue a1 = new KeyValue
+ using (PropertyValue pValue = new PropertyValue())
{
- PropertyValue = p1
- };
+ keyValue.PropertyValue = pValue;
+ tlog.Debug(tag, "PropertyValue : " + keyValue.PropertyValue);
+ }
- p1 = a1.PropertyValue;
-
- a1.Dispose();
tlog.Debug(tag, $"KeyValuePropertyValue END (OK)");
- Assert.Pass("KeyValuePropertyValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueIntergerValue START");
- KeyValue a1 = new KeyValue
- {
- IntergerValue = 10
- };
-
- int b1 = a1.IntergerValue;
+ keyValue.IntergerValue = 10;
+ tlog.Debug(tag, "IntergerValue : " + keyValue.IntergerValue);
- a1.Dispose();
tlog.Debug(tag, $"KeyValueIntergerValue END (OK)");
- Assert.Pass("KeyValueIntergerValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueBooleanValue START");
- KeyValue a1 = new KeyValue
- {
- BooleanValue = true
- };
+ keyValue.BooleanValue = true;
+ tlog.Debug(tag, "BooleanValue : " + keyValue.BooleanValue);
- bool b1 = a1.BooleanValue;
+ var strVal = keyValue.StringValue;
+ Assert.AreEqual("error to get StringValue", strVal, "Should be equal!");
- a1.Dispose();
tlog.Debug(tag, $"KeyValueBooleanValue END (OK)");
- Assert.Pass("KeyValueBooleanValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueSingleValue START");
- KeyValue a1 = new KeyValue
- {
- SingleValue = 10
- };
-
- float b1 = a1.SingleValue;
+ keyValue.SingleValue = 10;
+ tlog.Debug(tag, "SingleValue : " + keyValue.SingleValue);
- a1.Dispose();
tlog.Debug(tag, $"KeyValueSingleValue END (OK)");
- Assert.Pass("KeyValueSingleValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueStringValue START");
- KeyValue a1 = new KeyValue
- {
- StringValue = "stringvalue"
- };
-
- string b1 = a1.StringValue;
+ keyValue.StringValue = "stringvalue";
+ tlog.Debug(tag, "SingleValue : " + keyValue.StringValue);
- a1.Dispose();
tlog.Debug(tag, $"KeyValueStringValue END (OK)");
- Assert.Pass("KeyValueStringValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueVector2Value START");
- Vector2 b1 = new Vector2(1, 1);
- KeyValue a1 = new KeyValue
+ using (Vector2 vec2 = new Vector2(1, 1))
{
- Vector2Value = b1
- };
-
- b1 = a1.Vector2Value;
+ keyValue.Vector2Value = vec2;
+ tlog.Debug(tag, "Vector2Value : " + keyValue.Vector2Value);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueVector2Value END (OK)");
- Assert.Pass("KeyValueVector2Value");
}
[Test]
{
tlog.Debug(tag, $"KeyValueVector3Value START");
- Vector3 b1 = new Vector3(1, 1, 1);
- KeyValue a1 = new KeyValue
+ using (Vector3 vec3 = new Vector3(1, 1, 1))
{
- Vector3Value = b1
- };
+ keyValue.Vector3Value = vec3;
+ tlog.Debug(tag, "Vector2Value : " + keyValue.Vector3Value);
+ }
- b1 = a1.Vector3Value;
-
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueVector3Value END (OK)");
- Assert.Pass("KeyValueVector3Value");
}
[Test]
{
tlog.Debug(tag, $"KeyValueVector4Value START");
- Vector4 b1 = new Vector4(1, 1, 1, 0);
- KeyValue a1 = new KeyValue
+ using (Vector4 vec4 = new Vector4(1, 1, 1, 0))
{
- Vector4Value = b1
- };
-
- b1 = a1.Vector4Value;
+ keyValue.Vector4Value = vec4;
+ tlog.Debug(tag, "Vector4Value : " + keyValue.Vector4Value);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueVector4Value END (OK)");
- Assert.Pass("KeyValueVector4Value");
}
[Test]
{
tlog.Debug(tag, $"KeyValuePositionValue START");
- Position b1 = new Position(1, 1, 0);
- KeyValue a1 = new KeyValue
+ using (Position pos = new Position(1, 1, 0))
{
- PositionValue = b1
- };
+ keyValue.PositionValue = pos;
+ tlog.Debug(tag, "PositionValue : " + keyValue.PositionValue);
+ }
- b1 = a1.PositionValue;
-
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValuePositionValue END (OK)");
- Assert.Pass("KeyValuePositionValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValuePosition2DValue START");
- Position2D b1 = new Position2D(1, 1);
- KeyValue a1 = new KeyValue
+ using (Position2D pos2d = new Position2D(1, 1))
{
- Position2DValue = b1
- };
-
- b1 = a1.Position2DValue;
+ keyValue.Position2DValue = pos2d;
+ tlog.Debug(tag, "Position2DValue : " + keyValue.Position2DValue.X);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValuePosition2DValue END (OK)");
- Assert.Pass("KeyValuePosition2DValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueSizeValue START");
- Size b1 = new Size(1, 1, 0);
- KeyValue a1 = new KeyValue
+ using (Size size = new Size(1, 1, 0))
{
- SizeValue = b1
- };
+ keyValue.SizeValue = size;
+ tlog.Debug(tag, "SizeValue : " + keyValue.SizeValue);
+ }
- b1 = a1.SizeValue;
-
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueSizeValue END (OK)");
- Assert.Pass("KeyValueSizeValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueSize2DValue START");
- Size2D b1 = new Size2D(0, 0);
- KeyValue a1 = new KeyValue
+ using (Size2D size2d = new Size2D(0, 0))
{
- Size2DValue = b1
- };
-
- b1 = a1.Size2DValue;
+ keyValue.Size2DValue = size2d;
+ tlog.Debug(tag, "Size2DValue : " + keyValue.Size2DValue);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueSize2DValue END (OK)");
- Assert.Pass("KeyValueSize2DValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueColorValue START");
- Color b1 = new Color(0, 0, 0, 0);
- KeyValue a1 = new KeyValue
+ using (Color color = new Color(0, 0, 0, 0))
{
- ColorValue = b1
- };
-
- b1 = a1.ColorValue;
+ keyValue.ColorValue = color;
+ tlog.Debug(tag, "ColorValue : " + keyValue.ColorValue);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueColorValue END (OK)");
- Assert.Pass("KeyValueColorValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueRectangleValue START");
- Rectangle b1 = new Rectangle(0, 0, 0, 0);
- KeyValue a1 = new KeyValue
+ using (Rectangle rec = new Rectangle(0, 0, 0, 0))
{
- RectangleValue = b1
- };
+ keyValue.RectangleValue = rec;
+ tlog.Debug(tag, "RectangleValue : " + keyValue.RectangleValue);
+ }
- b1 = a1.RectangleValue;
-
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueRectangleValue END (OK)");
- Assert.Pass("KeyValueRectangleValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueRotationValue START");
- Rotation b1 = new Rotation();
- KeyValue a1 = new KeyValue
+ using (Rotation rotation = new Rotation())
{
- RotationValue = b1
- };
-
- b1 = a1.RotationValue;
+ keyValue.RotationValue = rotation;
+ tlog.Debug(tag, "RotationValue : " + keyValue.RotationValue);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueRotationValue END (OK)");
- Assert.Pass("KeyValueRotationValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValueRelativeVector2Value START");
- RelativeVector2 b1 = new RelativeVector2(0, 0);
- KeyValue a1 = new KeyValue
+ using (RelativeVector2 rVec2 = new RelativeVector2(0, 0))
{
- RelativeVector2Value = b1
- };
-
- b1 = a1.RelativeVector2Value;
+ keyValue.RelativeVector2Value = rVec2;
+ tlog.Debug(tag, "RelativeVector2Value : " + keyValue.RelativeVector2Value);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueRelativeVector2Value END (OK)");
- Assert.Pass("KeyValueRelativeVector2Value");
}
[Test]
{
tlog.Debug(tag, $"KeyValueRelativeVector3Value START");
- RelativeVector3 b1 = new RelativeVector3(0, 0, 0);
- KeyValue a1 = new KeyValue
+ using (RelativeVector3 rVec3 = new RelativeVector3(0, 0, 0))
{
- RelativeVector3Value = b1
- };
+ keyValue.RelativeVector3Value = rVec3;
+ tlog.Debug(tag, "RelativeVector3Value : " + keyValue.RelativeVector3Value);
+ }
- b1 = a1.RelativeVector3Value;
-
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueRelativeVector3Value END (OK)");
- Assert.Pass("KeyValueRelativeVector3Value");
}
[Test]
{
tlog.Debug(tag, $"KeyValueRelativeVector4Value START");
- RelativeVector4 b1 = new RelativeVector4(0, 0, 0, 0);
- KeyValue a1 = new KeyValue
+ using (RelativeVector4 rVec4 = new RelativeVector4(0, 0, 0, 0))
{
- RelativeVector4Value = b1
- };
-
- b1 = a1.RelativeVector4Value;
+ keyValue.RelativeVector4Value = rVec4;
+ tlog.Debug(tag, "RelativeVector4Value : " + keyValue.RelativeVector4Value);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueRelativeVector4Value END (OK)");
- Assert.Pass("KeyValueRelativeVector4Value");
}
[Test]
{
tlog.Debug(tag, $"KeyValueExtentsValue START");
- Extents b1 = new Extents(0, 0, 0, 0);
- KeyValue a1 = new KeyValue
+ using (Extents ext = new Extents(0, 0, 0, 0))
{
- ExtentsValue = b1
- };
-
- b1 = a1.ExtentsValue;
+ keyValue.ExtentsValue = ext;
+ tlog.Debug(tag, "ExtentsValue : " + keyValue.ExtentsValue);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValueExtentsValue END (OK)");
- Assert.Pass("KeyValueExtentsValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValuePropertyArrayValue START");
- PropertyArray b1 = new PropertyArray();
- KeyValue a1 = new KeyValue
+ using (PropertyArray pArr = new PropertyArray())
{
- PropertyArrayValue = b1
- };
+ keyValue.PropertyArrayValue = pArr;
+ tlog.Debug(tag, "PropertyArrayValue : " + keyValue.PropertyArrayValue);
+ }
- b1 = a1.PropertyArrayValue;
-
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValuePropertyArrayValue END (OK)");
- Assert.Pass("KeyValuePropertyArrayValue");
}
[Test]
{
tlog.Debug(tag, $"KeyValuePropertyMapValue START");
- PropertyMap b1 = new PropertyMap();
- KeyValue a1 = new KeyValue
+ using (PropertyMap pMap = new PropertyMap())
{
- PropertyMapValue = b1
- };
-
- b1 = a1.PropertyMapValue;
+ keyValue.PropertyMapValue = pMap;
+ tlog.Debug(tag, "PropertyMapValue : " + keyValue.PropertyMapValue);
+ }
- b1.Dispose();
- a1.Dispose();
tlog.Debug(tag, $"KeyValuePropertyMapValue END (OK)");
- Assert.Pass("KeyValuePropertyMapValue");
}
- }
+ [Test]
+ [Category("P1")]
+ [Description("KeyValue IntergerValue")]
+ [Property("SPEC", "Tizen.NUI.KeyValue.IntergerValue A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void KeyValueIntergerValueGetError()
+ {
+ tlog.Debug(tag, $"KeyValueIntergerValueGetError START");
+
+ keyValue.Value = "IntergerValue";
+
+ var result = keyValue.IntergerValue;
+ Assert.AreEqual(-1, result, "Should be equal!");
+
+ var sigVal = keyValue.SingleValue;
+ Assert.AreEqual(-1, sigVal, "Should be equal!");
+
+ var boolVal = keyValue.BooleanValue;
+ Assert.AreEqual(false, boolVal, "Should be equal!");
+
+ var v2Value = keyValue.Vector2Value;
+ Assert.AreEqual(0, v2Value.X, "Should be equal!");
+ Assert.AreEqual(0, v2Value.Y, "Should be equal!");
+
+ var v3Value = keyValue.Vector3Value;
+ Assert.AreEqual(0, v3Value.X, "Should be equal!");
+ Assert.AreEqual(0, v3Value.Y, "Should be equal!");
+ Assert.AreEqual(0, v3Value.Z, "Should be equal!");
+
+ var v4Value = keyValue.Vector4Value;
+ Assert.AreEqual(0, v4Value.X, "Should be equal!");
+ Assert.AreEqual(0, v4Value.Y, "Should be equal!");
+ Assert.AreEqual(0, v4Value.Z, "Should be equal!");
+ Assert.AreEqual(0, v4Value.W, "Should be equal!");
+
+ var pos = keyValue.PositionValue;
+ Assert.AreEqual(0, pos.X, "Should be equal!");
+ Assert.AreEqual(0, pos.Y, "Should be equal!");
+ Assert.AreEqual(0, pos.Z, "Should be equal!");
+
+ var size = keyValue.SizeValue;
+ Assert.AreEqual(0, size.Width, "Should be equal!");
+ Assert.AreEqual(0, size.Height, "Should be equal!");
+ Assert.AreEqual(0, size.Depth, "Should be equal!");
+
+ var size2d = keyValue.Size2DValue;
+ Assert.AreEqual(0, size2d.Width, "Should be equal!");
+ Assert.AreEqual(0, size2d.Height, "Should be equal!");
+
+ var colorVal = keyValue.ColorValue;
+ Assert.AreEqual(0, colorVal.R, "Should be equal!");
+ Assert.AreEqual(0, colorVal.G, "Should be equal!");
+ Assert.AreEqual(0, colorVal.B, "Should be equal!");
+ Assert.AreEqual(0, colorVal.A, "Should be equal!");
+
+ var recVal = keyValue.RectangleValue;
+ Assert.AreEqual(0, recVal.X, "Should be equal!");
+ Assert.AreEqual(0, recVal.Y, "Should be equal!");
+ Assert.AreEqual(0, recVal.Width, "Should be equal!");
+ Assert.AreEqual(0, recVal.Height, "Should be equal!");
+
+ var relativeV2 = keyValue.RelativeVector2Value;
+ Assert.AreEqual(0, relativeV2.X, "Should be equal!");
+ Assert.AreEqual(0, relativeV2.Y, "Should be equal!");
+
+ var relativeV3 = keyValue.RelativeVector3Value;
+ Assert.AreEqual(0, relativeV3.X, "Should be equal!");
+ Assert.AreEqual(0, relativeV3.Y, "Should be equal!");
+ Assert.AreEqual(0, relativeV3.Z, "Should be equal!");
+
+ var relativeV4 = keyValue.RelativeVector4Value;
+ Assert.AreEqual(0, relativeV4.X, "Should be equal!");
+ Assert.AreEqual(0, relativeV4.Y, "Should be equal!");
+ Assert.AreEqual(0, relativeV4.Z, "Should be equal!");
+ Assert.AreEqual(0, relativeV4.W, "Should be equal!");
+
+ var extVal = keyValue.ExtentsValue;
+ Assert.AreEqual(0, extVal.Start, "Should be equal!");
+ Assert.AreEqual(0, extVal.End, "Should be equal!");
+ Assert.AreEqual(0, extVal.Top, "Should be equal!");
+ Assert.AreEqual(0, extVal.Bottom, "Should be equal!");
+
+ var propertyArr = keyValue.PropertyArrayValue;
+ Assert.IsNotNull(propertyArr, "Can't create success object PropertyArray");
+ Assert.IsInstanceOf<PropertyArray>(propertyArr, "Should be an instance of PropertyArray type.");
+
+ var propertyMap = keyValue.PropertyMapValue;
+ Assert.IsNotNull(propertyMap, "Can't create success object PropertyMap");
+ Assert.IsInstanceOf<PropertyMap>(propertyMap, "Should be an instance of PropertyMap type.");
+
+ tlog.Debug(tag, $"KeyValueIntergerValueGetError END (OK)");
+ }
+ }
}
\ No newline at end of file
try
{
ExternalThemeManager.SetTheme("Tizen.NUI.Theme.Common");
+ ExternalThemeManager.SetTheme(ThemeManager.CurrentTheme.Id);
}
catch (Exception e)
{
try
{
var result = testingTarget.ThemeId;
- tlog.Debug(tag, "themeId :" + result);
+ tlog.Debug(tag, "ThemeId :" + result);
+
+ result = testingTarget.PlatformThemeId;
+ tlog.Debug(tag, "PlatformThemeId : " + result);
+ tlog.Debug(tag, "IsPlatformThemeChanged :" + testingTarget.IsPlatformThemeChanged);
}
catch (Exception e)
{
private const string tag = "NUITEST";
private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+ internal class IThemeCreatorImpy : IThemeCreator
+ {
+ public Theme Create()
+ {
+ var path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+ return new Theme(path);
+ }
+ }
+
[SetUp]
public void Init()
{
tlog.Debug(tag, $"ThemeManagerplatformThemeEnabled START");
ThemeManager.PlatformThemeEnabled = true;
- tlog.Debug(tag, "PlatformThemeEnabled : " + ThemeManager.PlatformThemeEnabled);
+ tlog.Error(tag, "PlatformThemeEnabled : " + ThemeManager.PlatformThemeEnabled);
var result = ThemeManager.ApplyPlatformTheme("Tizen.NUI.Theme.Common");
- tlog.Debug(tag, "ApplyPlatformTheme : " + result);
- tlog.Debug(tag, "GetPlatformStyle : " + ThemeManager.GetPlatformStyle("style"));
- tlog.Debug(tag, "GetPlatformStyle : " + ThemeManager.GetPlatformStyle(typeof(ViewStyle)));
+ tlog.Error(tag, "ApplyPlatformTheme : " + result);
+ tlog.Error(tag, "GetPlatformStyle : " + ThemeManager.GetPlatformStyle("style"));
+ tlog.Error(tag, "GetPlatformStyle : " + ThemeManager.GetPlatformStyle(typeof(ViewStyle)));
tlog.Debug(tag, $"ThemeManagerplatformThemeEnabled END (OK)");
}
tlog.Debug(tag, $"ThemeManagerApplyFallbackTheme END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ThemeManager AddPackageTheme.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.AddPackageTheme M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ public void ThemeManagerAddPackageTheme()
+ {
+ tlog.Debug(tag, $"ThemeManagerAddPackageTheme START");
+
+ try
+ {
+ ThemeManager.AddPackageTheme(new IThemeCreatorImpy());
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"ThemeManagerAddPackageTheme END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ThemeManager ApplyExternalPlatformTheme.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.ApplyExternalPlatformTheme M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ public void ThemeManagerApplyExternalPlatformTheme()
+ {
+ tlog.Debug(tag, $"ThemeManagerApplyExternalPlatformTheme START");
+
+ var theme = new Theme(path);
+ ViewStyle style = new ViewStyle()
+ {
+ Color = Color.Cyan,
+ };
+
+ theme.AddStyle("style", style);
+
+ try
+ {
+ ThemeManager.ApplyExternalPlatformTheme(theme.Id, theme.Version);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"ThemeManagerApplyExternalPlatformTheme END (OK)");
+ }
}
}
tlog.Debug(tag, $"WidgetViewManagerInstance END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("WidgetViewManager AddWidget.")]
- //[Property("SPEC", "Tizen.NUI.WidgetViewManager.AddWidget M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void WidgetViewManagerAddWidget()
- //{
- // tlog.Debug(tag, $"WidgetViewManagerAddWidget START");
-
- // var testingTarget = new WidgetViewManager(widget.GetIntPtr(), false);
- // Assert.IsNotNull(testingTarget, "Can't create success object WidgetViewManager");
- // Assert.IsInstanceOf<WidgetViewManager>(testingTarget, "Should be an instance of WidgetViewManager type.");
-
- // var result = testingTarget.AddWidget(widget.Id.ToString(), "widget", 100, 200, 50.0f);
- // Assert.IsNotNull(result, "Can't create success object WidgetView");
- // Assert.IsInstanceOf<WidgetView>(result, "Should be an instance of WidgetView type.");
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"WidgetViewManagerAddWidget END (OK)");
- //}
+ [Test]
+ [Category("P1")]
+ [Description("WidgetViewManager RemoveWidget.")]
+ [Property("SPEC", "Tizen.NUI.WidgetViewManager.RemoveWidget M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void WidgetViewManagerRemoveWidget()
+ {
+ tlog.Debug(tag, $"WidgetViewManagerRemoveWidget START");
+
+ var testingTarget = new WidgetViewManager(widget.GetIntPtr(), false);
+ Assert.IsNotNull(testingTarget, "Can't create success object WidgetViewManager");
+ Assert.IsInstanceOf<WidgetViewManager>(testingTarget, "Should be an instance of WidgetViewManager type.");
+
+ View view = new View()
+ {
+ Size = new Size(100, 200),
+ Color = Color.Cyan
+ };
+ WidgetView widgetView = new WidgetView(view.SwigCPtr.Handle, false);
+
+ var result = testingTarget.RemoveWidget(widgetView);
+ tlog.Debug(tag, "RemoveWidget : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"WidgetViewManagerRemoveWidget END (OK)");
+ }
[Test]
[Category("P1")]
[Test]
[Category("P1")]
+ [Description("WindowEvent.TransitionEffectEventArgs State.")]
+ [Property("SPEC", "Tizen.NUI.WindowEvent.TransitionEffectEventArgs.State A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void WindowEventTransitionEffectEventArgs()
+ {
+ tlog.Debug(tag, $"WindowEventTransitionEffectEventArgs START");
+
+ var testingTarget = new Window.TransitionEffectEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object Window");
+ Assert.IsInstanceOf<Window.TransitionEffectEventArgs>(testingTarget, "Should be an instance of Window.TransitionEffectEventArgs type.");
+
+ testingTarget.State = Window.EffectState.Start;
+ tlog.Debug(tag, "State : " + testingTarget.State);
+
+ testingTarget.Type = Window.EffectType.Show;
+ tlog.Debug(tag, "Type : " + testingTarget.Type);
+
+ tlog.Debug(tag, $"WindowEventTransitionEffectEventArgs END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("WindowEvent.VisibilityChangedEventArgs Visibility.")]
+ [Property("SPEC", "Tizen.NUI.WindowEvent.VisibilityChangedEventArgs.Visibility A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void WindowEventVisibilityChangedEventArgsVisibility()
+ {
+ tlog.Debug(tag, $"WindowEventVisibilityChangedEventArgsVisibility START");
+
+ var testingTarget = new Window.VisibilityChangedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object Window");
+ Assert.IsInstanceOf<Window.VisibilityChangedEventArgs>(testingTarget, "Should be an instance of Window.VisibilityChangedEventArgs type.");
+
+ testingTarget.Visibility = true;
+ tlog.Debug(tag, "Visibility : " + testingTarget.Visibility);
+
+ tlog.Debug(tag, $"WindowEventVisibilityChangedEventArgsVisibility END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("WindowEvent VisibiltyChangedSignalEmit.")]
+ [Property("SPEC", "Tizen.NUI.WindowEvent.VisibiltyChangedSignalEmit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void WindowEventVisibiltyChangedSignalEmit()
+ {
+ tlog.Debug(tag, $"WindowEventVisibiltyChangedSignalEmit START");
+
+ using (Rectangle rec = new Rectangle(0, 0, 2, 2))
+ {
+ var testingTarget = new Window(rec);
+ Assert.IsNotNull(testingTarget, "Can't create success object Window");
+ Assert.IsInstanceOf<Window>(testingTarget, "Should be an instance of Window type.");
+
+ try
+ {
+ testingTarget.VisibiltyChangedSignalEmit(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"WindowEventVisibiltyChangedSignalEmit END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("WindowEvent FocusChanged.")]
[Property("SPEC", "Tizen.NUI.WindowEvent.FocusChanged A")]
[Property("SPEC_URL", "-")]