using Tizen.NUI.UIComponents;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Test;
+using System.Threading.Tasks;
namespace Tizen.NUI.Tests
{
public class BaseHandleTests
{
private static string TAG = "NUI";
+ private static bool _flag = false;
[SetUp]
public static void Init()
Tizen.Log.Info(TAG, "Destroy() is called!");
}
+ private void baseHandleEventCallback(object sender, EventArgs e)
+ {
+ _flag = true;
+ }
+
[Test]
[Category("P1")]
[Description("dali BaseHandle constructor test")]
Assert.IsTrue(flag, "Should be true!");
}
-
+ [Test]
+ [Category("P1")]
+ [Description("PropertySet test, Check whether PropertySet event will be triggered.")]
+ [Property("SPEC", "Tizen.NUI.BaseHandle.PropertySet E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public async Task PropertySet_EVENT()
+ {
+ /* TEST CODE */
+ View view = new View();
+ view.Size2D = new Size2D(100, 100);
+ view.Position = new Position(100, 100, 0);
+ view.BackgroundColor = Color.Red;
+ _flag = false;
+ view.PropertySet += baseHandleEventCallback;
+ Window.Instance.GetDefaultLayer().Add(view);
+ view.StyleName = "fake";
+ await Task.Delay(20);
+ Assert.IsTrue(_flag, "Should be true!");
+ Window.Instance.GetDefaultLayer().Remove(view);
+ view.PropertySet -= baseHandleEventCallback;
+ }
[Test]
[Category("P1")]
[Test]
[Category("P1")]
+ [Description("Test cell position ColumnIndex.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.TableView.CellPosition.ColumnIndex A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void ColumnIndex_GET_VALUE()
+ {
+ TableView.CellPosition cell = new TableView.CellPosition(4, 3);
+ Assert.AreEqual(3, cell.ColumnIndex, "cell position ColumnIndex test fail.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test cell position RowIndex.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.TableView.CellPosition.RowIndex A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void RowIndex_GET_VALUE()
+ {
+ TableView.CellPosition cell = new TableView.CellPosition(3);
+ Assert.AreEqual(3, cell.RowIndex, "cell position RowIndex test fail.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test cell position ColumnSpan.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.TableView.CellPosition.ColumnSpan A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void ColumnSpan_GET_VALUE()
+ {
+ TableView.CellPosition cell = new TableView.CellPosition(4, 4, 4, 3);
+ Assert.AreEqual(3, cell.ColumnSpan, "cell position ColumnSpan test fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test cell position RowSpan.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.TableView.CellPosition.RowSpan A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void RowSpan_GET_VALUE()
+ {
+ TableView.CellPosition cell = new TableView.CellPosition(4, 4, 3);
+ Assert.AreEqual(3, cell.RowSpan, "cell position RowSpan test fail");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Test Dispose, try to dispose the CellPosition.")]
[Property("SPEC", "Tizen.NUI.BaseComponents.TableView.CellPosition.Dispose M")]
[Property("SPEC_URL", "-")]
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.BaseComponents.View.ChildAddedEventArgs Tests")]
+ public class ChildAddedEventArgsTests
+ {
+ private static string TAG = "NUI";
+
+ [SetUp]
+ public static void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ChildAddedEventArgsTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public static void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a ChildAddedEventArgs object. Check whether ChildAddedEventArgs is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ChildAddedEventArgs.ChildAddedEventArgs C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void ChildAddedEventArgs_INIT()
+ {
+ /* TEST CODE */
+ var childAddedEventArgs = new View.ChildAddedEventArgs();
+ Assert.IsNotNull(childAddedEventArgs, "Can't create success object ChildAddedEventArgs");
+ Assert.IsInstanceOf<View.ChildAddedEventArgs>(childAddedEventArgs, "Should be an instance of ChildAddedEventArgs type.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Added. Check whether Added is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ChildAddedEventArgs.Added A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void Added_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ View.ChildAddedEventArgs childAddedEventArgs = new View.ChildAddedEventArgs();
+ View view = new View();
+ childAddedEventArgs.Added = view;
+ Assert.AreEqual(view, childAddedEventArgs.Added, "Added View should be equal to set value");
+ }
+
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.BaseComponents.View.ChildRemovedEventArgs Tests")]
+ public class ChildRemovedEventArgsTests
+ {
+ private static string TAG = "NUI";
+
+ [SetUp]
+ public static void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ChildRemovedEventArgsTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public static void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a ChildRemovedEventArgs object. Check whether ChildRemovedEventArgs is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ChildRemovedEventArgs.ChildRemovedEventArgs C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void ChildRemovedEventArgs_INIT()
+ {
+ /* TEST CODE */
+ var childRemovedEventArgs = new View.ChildRemovedEventArgs();
+ Assert.IsNotNull(childRemovedEventArgs, "Can't create success object ChildRemovedEventArgs");
+ Assert.IsInstanceOf<View.ChildRemovedEventArgs>(childRemovedEventArgs, "Should be an instance of ChildRemovedEventArgs type.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Removed. Check whether Removed is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ChildRemovedEventArgs.Removed A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public void Removed_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ View.ChildRemovedEventArgs childRemovedEventArgs = new View.ChildRemovedEventArgs();
+ View view = new View();
+ childRemovedEventArgs.Removed = view;
+ Assert.AreEqual(view, childRemovedEventArgs.Removed, "Removed View should be equal to set value");
+ }
+
+ }
+}
Window.Instance.GetDefaultLayer().Remove(parentActor);
}
-
-
[Test]
[Category("P1")]
[Description("Test WorldColor. Check whether WorldColor returns expected value or not.")]
Window.Instance.GetDefaultLayer().Remove(view);
view.LayoutDirectionChanged -= viewEventCallback;
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ChildAdded. Test whether the ChildAdded event will be triggered when the view has been add to the window.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ChildAdded E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public async Task ChildAdded_CHECK_EVENT()
+ {
+ View childActor = new View();
+ View parentActor = new View();
+ parentActor.ChildAdded += viewEventCallback;
+ Window.Instance.GetDefaultLayer().Add(childActor);
+ Window.Instance.GetDefaultLayer().Add(parentActor);
+ parentActor.Add(childActor);
+ await Task.Delay(20);
+ Assert.IsTrue(_flag, "Should be true!");
+ Window.Instance.GetDefaultLayer().Remove(childActor);
+ Window.Instance.GetDefaultLayer().Remove(parentActor);
+ parentActor.ChildAdded -= viewEventCallback;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ChildRemoved. Test whether the ChildRemoved event will be triggered when the view has been add to the window.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ChildRemoved E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+ public async Task ChildRemoved_CHECK_EVENT()
+ {
+ View childActor = new View();
+ View parentActor = new View();
+ parentActor.ChildRemoved += viewEventCallback;
+ parentActor.Add(childActor);
+ await Task.Delay(20);
+ parentActor.Remove(childActor);
+ await Task.Delay(20);
+ Assert.IsTrue(_flag, "Should be true!");
+ parentActor.ChildRemoved -= viewEventCallback;
+ }
+
}
}