--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme
+ xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ Id="TestTheme">
+
+ <ViewStyle x:Key="Style1" Size="200, 200" Position="0, 0" BackgroundColor="Red" />
+
+ <ViewStyle x:Key="Style2" Size="100, 100" Position="10, 10" BackgroundColor="Blue" />
+
+ <ViewStyle x:Key="Style3" Size="50, 50" Position="20, 20" BackgroundColor="Yellow" />
+
+</Theme>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Theme
+ xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ Id="TestTheme">
+
+ <ViewStyle x:Key="Style1" Size="200, 200" Pos="0, 0" BackgroundColor="Red" />
+
+ <Style x:Key="Style2" Size="100, 100" Position="10, 10" BackgroundColor="Blue" />
+
+ <ViewStyle x:Key="Style3" Size="50, 50" Position="20, 20" BackgroundColor="Yellow" />
+
+</Theme>
\ No newline at end of file
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.BaseComponents.ControlState Tests")]
+ public class ControlStateTests
+ {
+ private string TAG = "Test for ControlState.cs";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Create")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.Create M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Create_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var controlState = ControlState.Create("Pressed");
+ Assert.IsNotNull(controlState, "Should be not null");
+ Assert.IsInstanceOf<ControlState>(controlState, "Should return ControlState instance.");
+ Assert.IsTrue(controlState.Equals(ControlState.Pressed), "Should equals to pre-defined Pressed property.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test Create throws ArgumentNullException when the argument is null")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.Create M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Create_ARGUMENT_NULL_EXCEPTION()
+ {
+ Assert.Throws<ArgumentNullException>(() => ControlState.Create((string)null));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test Create throws ArgumentException when the argument is empty string")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.Create M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Create_ARGUMENT_EXCEPTION()
+ {
+ Assert.Throws<ArgumentException>(() => ControlState.Create(""));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Contains")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.Contains M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "ControlState")]
+ public void Contains_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var controlState = ControlState.Selected + ControlState.Disabled;
+ Assert.IsNotNull(controlState, "Should be not null");
+ Assert.IsTrue(controlState.Contains(ControlState.Selected), "Should contain Selected state.");
+ Assert.IsTrue(controlState.Contains(ControlState.Disabled), "Should contain Disabled state.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test Contains throws ArgumentNullException when the argument is null")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.Contains M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "ControlState")]
+ public void Contains_ARGUMENT_NULL_EXCEPTION()
+ {
+ Assert.Throws<ArgumentNullException>(() => ControlState.Focused.Contains(null));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Equals")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.Equals M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "ControlState")]
+ public void Equals_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ Assert.IsTrue(ControlState.Selected.Equals(ControlState.Selected), "Should be true for the same reference.");
+ Assert.IsTrue(ControlState.Selected.Equals(ControlState.Create("Selected")), "Should be true for the same name.");
+ Assert.IsFalse(ControlState.Selected.Equals(null), "Should be false for null value.");
+ Assert.IsFalse(ControlState.Selected.Equals(ControlState.Create(ControlState.Selected, ControlState.Pressed)), "Should be false for the different content.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test operator ==.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.== M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Equality_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ Assert.IsTrue(ControlState.Selected == ControlState.Selected, "Should be true for the same reference.");
+ Assert.IsTrue(ControlState.Selected == ControlState.Create("Selected"), "Should be true for the same name.");
+ Assert.IsFalse(ControlState.Selected == null, "Should be false for null value.");
+ Assert.IsFalse(null == ControlState.Selected, "Should be false for null value.");
+ Assert.IsFalse(ControlState.Selected == ControlState.Create(ControlState.Selected, ControlState.Pressed), "Should be false for the different content.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test operator !=.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.!= M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Inequality_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ Assert.IsTrue(ControlState.Selected != ControlState.Pressed, "Selected and Pressed should not equal.");
+ Assert.IsTrue(ControlState.Selected != null, "Null should not equals to ControlState.Selected.");
+ Assert.IsTrue(null != ControlState.Selected, "Null should not equals to ControlState.Selected.");
+ Assert.IsFalse(ControlState.Selected != ControlState.Selected, "Should be false for the same reference.");
+ Assert.IsFalse(ControlState.Selected != ControlState.Create("Selected"), "Should be false for the same name.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test operator +.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ControlState.+ M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Addition_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ Assert.IsTrue(ControlState.Pressed.Equals(ControlState.Normal + ControlState.Pressed), "Normal + Pressed = Pressed");
+ Assert.IsTrue(ControlState.Pressed.Equals(ControlState.Pressed + ControlState.Pressed), "Pressed + Pressed = Pressed");
+ Assert.IsTrue(ControlState.Pressed.Equals(ControlState.Normal + ControlState.Pressed + ControlState.Pressed), "Normal + Pressed + Pressed = Pressed");
+
+ var combinedState = ControlState.Selected + ControlState.Disabled;
+ Assert.IsTrue(combinedState.Contains(ControlState.Selected), "SelectedDisabled state contains Selected state.");
+ Assert.IsTrue(combinedState.Contains(ControlState.Disabled), "SelectedDisabled state contains Disabled state.");
+ Assert.IsFalse(combinedState.Contains(ControlState.Pressed), "SelectedDisabled state does not contain Pressed state.");
+ }
+
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.BaseComponents.Selector Tests")]
+ public class SelectorTests
+ {
+ private string TAG = "Test for Selector.cs";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test empty constructor")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector<T>.Selector C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Selector_INIT()
+ {
+ /* TEST CODE */
+ var selector = new Selector<int>();
+ Assert.IsNotNull(selector, "Should be not null");
+ Assert.IsInstanceOf<Selector<int>>(selector, "Should return Selector instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test implicit T. Try to convert a T value to a Selector<T> instance.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponens.Selector<T>.implicit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "T")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void implicit_T_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ // Test T of Vector2
+ Selector<Vector2> selector1 = new Vector2(10.0f, 10.0f);
+ Assert.IsNotNull(selector1, "Should be not null");
+ Assert.IsInstanceOf<Selector<Vector2>>(selector1, "Should return Selector<Vector2> instance.");
+
+ // Test T of float
+ Selector<float> selector2 = 10.0f;
+ Assert.IsNotNull(selector2, "Should be not null");
+ Assert.IsInstanceOf<Selector<float>>(selector2, "Should return Selector<float> instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Add")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector<T>.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "SelectorItem<T>")]
+ public void Add_CHECK_STATUS()
+ {
+ /* TEST CODE */
+ var testValue = Color.Black;
+ Selector<Color> expected = testValue;
+
+ Selector<Color> selector = new Selector<Color>();
+ Assert.IsNotNull(selector, "Should be not null");
+
+ selector.Add(new SelectorItem<Color>(ControlState.All, testValue));
+ Assert.IsTrue(selector.Equals(expected), "Should equal to the expected selector.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test Add throws ArgumentNullException when the argument is null")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector<T>.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "SelectorItem<T>")]
+ public void Add_ARGUMENT_NULL_EXCEPTION()
+ {
+ var selector = new Selector<Position>();
+ Assert.Throws<ArgumentNullException>(() => selector.Add(null));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Equals.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.Selector<T>.Equals M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Equals_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ Selector<Vector2> selector1 = new Vector2(10.0f, 10.0f);
+ Selector<Vector2> selector2 = new Selector<Vector2>();
+ selector2.Add(new SelectorItem<Vector2>(ControlState.All, new Vector2(10.0f, 10.0f)));
+
+ Assert.IsTrue(selector1.Equals(selector2), "Two selectors should be equal.");
+ Assert.IsFalse(selector1.Equals(null), "Selector.Equals should return false when comparing a selector and null.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SelectorItem constructor")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.SelectorItem<T>.SelectorItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "ControlState, T")]
+ public void SelectorItem_INIT()
+ {
+ /* TEST CODE */
+ var selectorItem = new SelectorItem<Color>(ControlState.All, Color.Blue);
+ Assert.IsNotNull(selectorItem, "Should be not null");
+ Assert.IsInstanceOf<SelectorItem<Color>>(selectorItem, "Should return SelectorItem<Color> instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test State.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.SelectorItem<T>.State A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void State_READ_ONLY()
+ {
+ /* TEST CODE */
+ var selectorItem = new SelectorItem<int>(ControlState.Pressed, 10);
+ Assert.IsNotNull(selectorItem.State, "Should be not null");
+ Assert.IsTrue(selectorItem.State.Equals(ControlState.Pressed), "Should be equal to initial value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Value.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.SelectorItem<T>.Value A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Value_READ_ONLY()
+ {
+ /* TEST CODE */
+ int testValue = 10;
+ var selectorItem = new SelectorItem<int>(ControlState.Pressed, testValue);
+ Assert.AreEqual(selectorItem.Value, testValue, "Should be equal to initial value.");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.Shadow Tests")]
+ public class ShadowTests
+ {
+ private string TAG = "Test for Shadow.cs";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Shadow empty constructor")]
+ [Property("SPEC", "Tizen.NUI.Shadow.Shadow C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Shadow_INIT()
+ {
+ /* TEST CODE */
+ var shadow = new Shadow();
+ Assert.IsNotNull(shadow, "Should be not null");
+ Assert.IsInstanceOf<Shadow>(shadow, "Should return Shadow instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Shadow constructor with arguments")]
+ [Property("SPEC", "Tizen.NUI.Shadow.Shadow C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Single, Color, Vector2, Vector2")]
+ public void Shadow_INIT_WITH_ARGUMENTS()
+ {
+ /* TEST CODE */
+ var shadow1 = new Shadow(10.0f, new Color(1.0f, 0.0f, 0.0f, 1.0f));
+ Assert.IsInstanceOf<Shadow>(shadow1, "Should return Shadow instance.");
+
+ var shadow2 = new Shadow(10.0f, new Color(1.0f, 0.0f, 0.0f, 1.0f), new Vector2(2.0f, 3.0f));
+ Assert.IsInstanceOf<Shadow>(shadow2, "Should return Shadow instance.");
+
+ var shadow3 = new Shadow(10.0f, new Color(1.0f, 0.0f, 0.0f, 1.0f), new Vector2(2.0f, 3.0f), new Vector2(4.0f, 5.0f));
+ Assert.IsInstanceOf<Shadow>(shadow3, "Should return Shadow instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Color.")]
+ [Property("SPEC", "Tizen.NUI.Shadow.Color A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Color_READ_ONLY()
+ {
+ /* TEST CODE */
+ var testValue = Color.Red;
+ var shadow = new Shadow(10.0f, testValue);
+ Assert.IsNotNull(shadow.Color, "Should be not null");
+ Assert.IsTrue(shadow.Color.Equals(testValue), "Should be equal to initial value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test BlurRadius.")]
+ [Property("SPEC", "Tizen.NUI.Shadow.BlurRadius A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void BlurRadius_READ_ONLY()
+ {
+ /* TEST CODE */
+ var testValue = 11.2f;
+ var shadow = new Shadow(testValue, Color.Black);
+ Assert.AreEqual(shadow.BlurRadius, testValue, "Should be equal to initial value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Equals.")]
+ [Property("SPEC", "Tizen.NUI.Shadow.Equals M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Equals_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var shadow1 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 0.0f), null);
+ var shadow2 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 0.0f), null);
+ var shadow3 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 0.0f), new Vector2(5.0f, 2.0f));
+ var shadow4 = new Shadow(2.0f, Color.Blue, null, new Vector2(5.0f, 2.0f));
+ var shadow5 = new Shadow(2.0f, Color.Blue, null, new Vector2(5.0f, 2.0f));
+ var shadow6 = new Shadow(6.2f, Color.Blue, new Vector2(0.0f, 0.0f), new Vector2(5.0f, 2.0f));
+ var shadow7 = new Shadow(2.0f, Color.Green, new Vector2(0.0f, 0.0f), new Vector2(5.0f, 2.0f));
+ var shadow8 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 3.0f), new Vector2(5.0f, 2.0f));
+ var shadow9 = new Shadow(2.0f, Color.Blue, new Vector2(2.0f, 1.0f), new Vector2(11.0f, 0.0f));
+
+ Assert.True(shadow1.Equals(shadow2));
+ Assert.False(shadow1.Equals(shadow3));
+ Assert.False(shadow3.Equals(shadow4));
+ Assert.True(shadow4.Equals(shadow5));
+ Assert.False(shadow3.Equals(shadow6));
+ Assert.False(shadow3.Equals(shadow7));
+ Assert.False(shadow3.Equals(shadow8));
+ Assert.False(shadow3.Equals(shadow9));
+ Assert.False(shadow1.Equals(null));
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.ShadowBase Tests")]
+ public class ShadowBaseTests
+ {
+ private string TAG = "Test for ShadowBase.cs";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Offset.")]
+ [Property("SPEC", "Tizen.NUI.ShadowBase.Offset A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Offset_READ_ONLY()
+ {
+ /* TEST CODE */
+ var testValue = new Vector2(5.0f, 7.0f);
+ var shadow = new Shadow(10.0f, null, testValue/*Offset*/);
+ Assert.IsNotNull(shadow.Offset, "Should be not null");
+ Assert.IsTrue(shadow.Offset.Equals(testValue), "Should be equal to initial value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Value.")]
+ [Property("SPEC", "Tizen.NUI.ShadowBase.Extents A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Extents_READ_ONLY()
+ {
+ /* TEST CODE */
+ var testValue = new Vector2(7.0f, 5.0f);
+ var shadow = new Shadow(10.0f, null, null, testValue/*Extents*/);
+ Assert.IsNotNull(shadow.Extents, "Should be not null");
+ Assert.IsTrue(shadow.Extents.Equals(testValue), "Should be equal to initial value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test operator ==.")]
+ [Property("SPEC", "Tizen.NUI.ShadowBase.== M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Equality_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var shadow1 = new Shadow(0.0f, Color.Black, new Vector2(1.0f, 1.0f), null);
+ var shadow2 = new Shadow(0.0f, Color.Black, new Vector2(1.0f, 1.0f), null);
+ var shadow3 = new Shadow(0.0f, Color.Black, new Vector2(1.0f, 1.0f), new Vector2(0.5f, 1.0f));
+ var shadow4 = new Shadow(0.0f, Color.Black, null, new Vector2(0.5f, 1.0f));
+ var shadow5 = new Shadow(0.0f, Color.Black, null, new Vector2(0.5f, 1.0f));
+ var shadow6 = new Shadow(7.0f, Color.Black, new Vector2(1.0f, 1.0f), new Vector2(0.5f, 1.0f));
+ var shadow7 = new Shadow(0.0f, Color.Yellow, new Vector2(1.0f, 1.0f), new Vector2(0.5f, 1.0f));
+ var shadow8 = new Shadow(0.0f, Color.Black, new Vector2(0.0f, 7.0f), new Vector2(0.5f, 1.0f));
+ var shadow9 = new Shadow(0.0f, Color.Black, new Vector2(1.0f, 1.0f), new Vector2(2.0f, 0.0f));
+
+ Assert.True(shadow1 == shadow2);
+ Assert.False(shadow1 == shadow3);
+ Assert.False(shadow3 == shadow4);
+ Assert.True(shadow4 == shadow5);
+ Assert.False(shadow3 == shadow6);
+ Assert.False(shadow3 == shadow7);
+ Assert.False(shadow3 == shadow8);
+ Assert.False(shadow3 == shadow9);
+ Assert.False(shadow1 == null);
+ Assert.False(null == shadow2);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test operator !=.")]
+ [Property("SPEC", "Tizen.NUI.ShadowBase.!= M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Inequality_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var shadow1 = new Shadow(3.0f, Color.Red, new Vector2(2.0f, 1.0f), null);
+ var shadow2 = new Shadow(3.0f, Color.Red, new Vector2(2.0f, 1.0f), null);
+ var shadow3 = new Shadow(3.0f, Color.Red, new Vector2(2.0f, 1.0f), new Vector2(5.0f, 2.0f));
+ var shadow4 = new Shadow(3.0f, Color.Red, null, new Vector2(5.0f, 2.0f));
+ var shadow5 = new Shadow(3.0f, Color.Red, null, new Vector2(5.0f, 2.0f));
+ var shadow6 = new Shadow(0.0f, Color.Red, new Vector2(2.0f, 1.0f), new Vector2(5.0f, 2.0f));
+ var shadow7 = new Shadow(3.0f, Color.Blue, new Vector2(2.0f, 1.0f), new Vector2(5.0f, 2.0f));
+ var shadow8 = new Shadow(3.0f, Color.Red, new Vector2(0.0f, 3.0f), new Vector2(5.0f, 2.0f));
+ var shadow9 = new Shadow(3.0f, Color.Red, new Vector2(2.0f, 1.0f), new Vector2(11.0f, 0.0f));
+
+ Assert.False(shadow1 != shadow2);
+ Assert.True(shadow1 != shadow3);
+ Assert.True(shadow3 != shadow4);
+ Assert.False(shadow4 != shadow5);
+ Assert.True(shadow3 != shadow6);
+ Assert.True(shadow3 != shadow7);
+ Assert.True(shadow3 != shadow8);
+ Assert.True(shadow3 != shadow9);
+ Assert.True(shadow1 != null);
+ Assert.True(null != shadow2);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Equals.")]
+ [Property("SPEC", "Tizen.NUI.ShadowBase.Equals M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Equals_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var shadow1 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 0.0f), null);
+ var shadow2 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 0.0f), null);
+ var shadow3 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 0.0f), new Vector2(5.0f, 2.0f));
+ var shadow4 = new Shadow(2.0f, Color.Blue, null, new Vector2(5.0f, 2.0f));
+ var shadow5 = new Shadow(2.0f, Color.Blue, null, new Vector2(5.0f, 2.0f));
+ var shadow6 = new Shadow(6.2f, Color.Blue, new Vector2(0.0f, 0.0f), new Vector2(5.0f, 2.0f));
+ var shadow7 = new Shadow(2.0f, Color.Green, new Vector2(0.0f, 0.0f), new Vector2(5.0f, 2.0f));
+ var shadow8 = new Shadow(2.0f, Color.Blue, new Vector2(0.0f, 3.0f), new Vector2(5.0f, 2.0f));
+ var shadow9 = new Shadow(2.0f, Color.Blue, new Vector2(2.0f, 1.0f), new Vector2(11.0f, 0.0f));
+
+ Assert.True(shadow1.Equals(shadow2));
+ Assert.False(shadow1.Equals(shadow3));
+ Assert.False(shadow3.Equals(shadow4));
+ Assert.True(shadow4.Equals(shadow5));
+ Assert.False(shadow3.Equals(shadow6));
+ Assert.False(shadow3.Equals(shadow7));
+ Assert.False(shadow3.Equals(shadow8));
+ Assert.False(shadow3.Equals(shadow9));
+ Assert.False(shadow1.Equals(null));
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.Theme Tests")]
+ public class ThemeTests
+ {
+ private string TAG = "Test for Theme.cs";
+ private string xamlFile = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "testTheme.xaml";
+ private string invaildXamlFile = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "testWrongTheme.xaml";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test empty constructor.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Theme_INIT()
+ {
+ /* TEST CODE */
+ var theme = new Theme();
+ Assert.IsNotNull(theme, "Should be not null");
+ Assert.IsInstanceOf<Theme>(theme, "Should return Theme instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test constructor with arguments.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Theme_NO_EXCEPTION()
+ {
+ /* TEST CODE */
+ var theme = new Theme(xamlFile);
+ Assert.IsNotNull(theme, "Should be not null");
+ Assert.IsInstanceOf<Theme>(theme, "Should return Theme instance.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test constructor with null arguments.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Theme_ARGUMENT_NULL_EXCEPTION()
+ {
+ /* TEST CODE */
+ try
+ {
+ var theme = new Theme(null);
+ Assert.Fail("Must throw an exception");
+ }
+ catch (ArgumentNullException)
+ {
+ Assert.Pass("Catch ArgumentNullException successfully.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test constructor with invalid arguments.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Theme_IOEXCEPTION()
+ {
+ /* TEST CODE */
+ try
+ {
+ var theme = new Theme("No path exists");
+ Assert.Fail("Must throw an exception");
+ }
+ catch (global::System.IO.IOException)
+ {
+ Assert.Pass("Catch IOException successfully.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test constructor with invalid arguments.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void Theme_XAML_PARSE_EXCEPTION()
+ {
+ /* TEST CODE */
+ try
+ {
+ var theme = new Theme(invaildXamlFile);
+ Assert.Fail("Must throw an exception");
+ }
+ catch (Tizen.NUI.Xaml.XamlParseException)
+ {
+ Assert.Pass("Xaml parser throws an exception successfully.");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Id. Check whether Id is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Id A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Id_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = "TestId";
+ var theme = new Theme()
+ {
+ Id = testValue
+ };
+ Assert.AreEqual(testValue, theme.Id, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Version. Check whether Version is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Version A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Version_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = "TestVersion";
+ var theme = new Theme()
+ {
+ Version = testValue
+ };
+ Assert.AreEqual(testValue, theme.Version, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetStyle.")]
+ [Property("SPEC", "Tizen.NUI.Theme.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void GetStyle_RETURN_VALUE_WITH_STYLE_NAME()
+ {
+ /* TEST CODE */
+ var theme = new Theme(xamlFile);
+ var validStyle = theme.GetStyle("Style1");
+ var invalidStyle = theme.GetStyle("Style5");
+
+ Assert.IsNotNull(validStyle, "The Style1 should exist.");
+ Assert.IsNull(invalidStyle, "The Style5 should not exist.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test GetStyle with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.Theme.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void GetStyle_ARGUMENT_NULL_EXCEPTION_WITH_STYLE_NAME()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ var theme = new Theme();
+ string nullName = null;
+ var style = theme.GetStyle(nullName);
+ });
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetStyle.")]
+ [Property("SPEC", "Tizen.NUI.Theme.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Type")]
+ public void GetStyle_RETURN_VALUE_WITH_VIEW_TYPE()
+ {
+ /* TEST CODE */
+ var theme = new Theme();
+ theme.AddStyle(typeof(ImageView).FullName, new ViewStyle());
+
+ var validStyle = theme.GetStyle(typeof(ImageView));
+ var invalidStyle = theme.GetStyle(typeof(TextLabel));
+
+ Assert.IsNotNull(validStyle, "The Style1 should exist.");
+ Assert.IsNull(invalidStyle, "The Style5 should not exist.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test GetStyle with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.Theme.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Type")]
+ public void GetStyle_ARGUMENT_NULL_EXCEPTION_WITH_VIEW_TYPE()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ var theme = new Theme();
+ Type nullType = null;
+ var style = theme.GetStyle(nullType);
+ });
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AddStyle.")]
+ [Property("SPEC", "Tizen.NUI.Theme.AddStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string, ViewStyle")]
+ public void AddStyle_CHECK_STATUS()
+ {
+ /* TEST CODE */
+ var theme = new Theme();
+ Assert.IsNotNull(theme, "Should be not null");
+ Assert.IsInstanceOf<Theme>(theme, "Should return Theme instance.");
+
+ var styleName1 = "testStyle1";
+ var styleName2 = "testStyle2";
+ var position = new Position(1.0f, 2.0f);
+ var size = new Size(3.0f, 4.0f);
+ var pivotPoint = PivotPoint.Center;
+ var parentOrigin = ParentOrigin.CenterLeft;
+
+ theme.AddStyle(styleName1, new ViewStyle() { Position = position, Size = size });
+ theme.AddStyle(styleName2, new ViewStyle() { PivotPoint = pivotPoint, ParentOrigin = parentOrigin });
+
+ var style1 = theme.GetStyle(styleName1);
+ var style2 = theme.GetStyle(styleName2);
+
+ Assert.IsNotNull(style1, "The style1 should exist.");
+ Assert.IsTrue(position.Equals(style1.Position), "Should be equal to the set value.");
+ Assert.IsTrue(size.Equals(style1.Size), "Should be equal to the set value.");
+
+ Assert.IsNotNull(style2, "The style2 should exist.");
+ Assert.IsTrue(pivotPoint.Equals(style2.PivotPoint), "Should be equal to the set value.");
+ Assert.IsTrue(parentOrigin.Equals(style2.ParentOrigin), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test AddStyle with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.Theme.AddStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string, ViewStyle")]
+ public void AddStyle_ARGUMENT_NULL_EXCEPTION()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ var theme = new Theme();
+ theme.AddStyle(null, new ViewStyle());
+ });
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Clone.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Clone M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Clone_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var original = new Theme();
+ var styleName1 = "testStyleI";
+ var styleName2 = "testStyleJ";
+ var position = new Position(1.0f, 2.0f);
+ var size = new Size(3.0f, 4.0f);
+ var minimumSize = new Size2D(1, 1);
+ var maximumSize = new Size2D(100, 100);
+
+ original.AddStyle(styleName1, new ViewStyle() { Position = position, Size = size });
+ original.AddStyle(styleName2, new ViewStyle() { MinimumSize = minimumSize, MaximumSize = maximumSize });
+
+ var cloned = original.Clone() as Theme;
+ Assert.IsNotNull(cloned, "The cloned object should not be null.");
+
+ var style1 = cloned.GetStyle(styleName1);
+ var style2 = cloned.GetStyle(styleName2);
+
+ Assert.IsNotNull(style1, "The style1 should exist.");
+ Assert.IsTrue(position.Equals(style1.Position), "Should be equal to the set value.");
+ Assert.IsTrue(size.Equals(style1.Size), "Should be equal to the set value.");
+
+ Assert.IsNotNull(style2, "The style2 should exist.");
+ Assert.IsTrue(minimumSize.Equals(style2.MinimumSize), "Should be equal to the set value.");
+ Assert.IsTrue(maximumSize.Equals(style2.MaximumSize), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Merge.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Merge M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Theme")]
+ public void Merge_CHECK_STATUS()
+ {
+ /* TEST CODE */
+ var theme1 = new Theme();
+ var theme2 = new Theme();
+ var styleName1 = "testStyleA";
+ var styleName2 = "testStyleB";
+ var padding = new Extents(1, 2, 3, 4);
+ var margin = new Extents(5, 6, 7, 8);
+ var minimumSize = new Size2D(1, 1);
+ var maximumSize = new Size2D(100, 100);
+
+ theme1.AddStyle(styleName1, new ViewStyle() { Padding = padding, Margin = margin });
+ theme2.AddStyle(styleName2, new ViewStyle() { MinimumSize = minimumSize, MaximumSize = maximumSize });
+
+ theme1.Merge(theme2);
+
+ var style1 = theme1.GetStyle(styleName1);
+ var style2 = theme1.GetStyle(styleName2);
+
+ Assert.IsNotNull(style1, "The style1 should exist.");
+ Assert.IsTrue(padding.EqualTo(style1.Padding), "Should be equal to the set value.");
+ Assert.IsTrue(margin.EqualTo(style1.Margin), "Should be equal to the set value.");
+
+ Assert.IsNotNull(style2, "The style2 should exist.");
+ Assert.IsTrue(minimumSize.Equals(style2.MinimumSize), "Should be equal to the set value.");
+ Assert.IsTrue(maximumSize.Equals(style2.MaximumSize), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test Merge with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Merge M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Theme")]
+ public void Merge_ARGUMENT_NULL_EXCEPTION()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ var theme = new Theme();
+ Theme nullTheme = null;
+ theme.Merge(nullTheme);
+ });
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.ThemeChangedEventArgs Tests")]
+ public class ThemeChangedEventArgsTests
+ {
+ private string TAG = "Test for ThemeManager.cs";
+ private string eventArgsThemeId = null;
+
+ private void onThemeChanged(object sender, ThemeChangedEventArgs e)
+ {
+ eventArgsThemeId = e.ThemeId;
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ThemeId.")]
+ [Property("SPEC", "Tizen.NUI.ThemeChangedEventArgs.ThemeId A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ThemeId_READ_ONLY()
+ {
+ /* TEST CODE */
+ var testThemeName = "TestThemeId";
+ ThemeManager.ThemeChanged += onThemeChanged;
+ ThemeManager.ApplyTheme(new Theme() { Id = testThemeName });
+
+ Assert.AreEqual(testThemeName, eventArgsThemeId, "The theme name should be equal to the ThemeChangedEventArgs's ThemeId.");
+ ThemeManager.ThemeChanged -= onThemeChanged;
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.ThemeManager Tests")]
+ public class ThemeManagerTests
+ {
+ private string TAG = "Test for ThemeManager.cs";
+ private bool themeChangedEventCalled = false;
+ private string currentThemeName = null;
+
+ private void onThemeChangedForThemeName(object sender, ThemeChangedEventArgs e)
+ {
+ currentThemeName = e.ThemeId;
+ }
+
+ private void onThemeChanged(object sender, ThemeChangedEventArgs e)
+ {
+ themeChangedEventCalled = true;
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ ThemeManager.ThemeChanged += onThemeChangedForThemeName;
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ ThemeManager.ThemeChanged -= onThemeChangedForThemeName;
+ // Restore
+ ThemeManager.ApplyTheme(new Theme());
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ThemeChanged. Test whether the ThemeChanged event will be triggered when the theme manager changes theme.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.ThemeChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ThemeChanged_CHECK_EVENT()
+ {
+ ThemeManager.ThemeChanged += onThemeChanged;
+ Assert.IsFalse(themeChangedEventCalled, "The initial themeChangedEventCalled value should be false.");
+
+ ThemeManager.ApplyTheme(new Theme() { Id = "New Theme" });
+ ThemeManager.ThemeChanged -= onThemeChanged;
+
+ Assert.IsTrue(themeChangedEventCalled, "The themeChangedEventCalled should be true.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ApplyTheme.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.ApplyTheme M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ApplyTheme_CHECK_STATUS()
+ {
+ /* TEST CODE */
+ var testThemeName = "TestApplyTheme";
+ Assert.AreNotEqual(testThemeName, currentThemeName);
+
+ ThemeManager.ApplyTheme(new Theme() { Id = testThemeName });
+
+ Assert.AreEqual(testThemeName, currentThemeName, "The Applied theme name should be equal to the current theme name.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test ApplyTheme with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.ApplyTheme M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ApplyTheme_ARGUMENT_NULL_EXCEPTION()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ Theme nullTheme = null;
+ ThemeManager.ApplyTheme(nullTheme);
+ });
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetStyle.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void GetStyle_RETURN_VALUE_WITH_STYLE_NAME()
+ {
+ /* TEST CODE */
+ var theme = new Theme() { Id = "TestGetStyle" };
+ var styleName = "testStyleName";
+ var minimumSize = new Size2D(1, 1);
+ var maximumSize = new Size2D(100, 100);
+ theme.AddStyle(styleName, new ViewStyle() { MinimumSize = minimumSize, MaximumSize = maximumSize });
+
+ ThemeManager.ApplyTheme(theme);
+
+ var validStyle = ThemeManager.GetStyle(styleName);
+ var invalidStyle = ThemeManager.GetStyle("NoSuchNameExistForTest");
+
+ Assert.IsNotNull(validStyle, "The validStyle should exist.");
+ Assert.IsNull(invalidStyle, "The invalidStyle should not exist.");
+ Assert.IsTrue(minimumSize.Equals(validStyle.MinimumSize), "Should be equal to the set value.");
+ Assert.IsTrue(maximumSize.Equals(validStyle.MaximumSize), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test GetStyle with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "string")]
+ public void GetStyle_ARGUMENT_NULL_EXCEPTION_WITH_STYLE_NAME()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ string nullName = null;
+ var style = ThemeManager.GetStyle(nullName);
+ });
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetStyle.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Type")]
+ public void GetStyle_RETURN_VALUE_WITH_VIEW_TYPE()
+ {
+ /* TEST CODE */
+ var theme = new Theme() { Id = "TestGetStyle2" };
+ var styleType = typeof(ImageView);
+ var position = new Position(1.0f, 2.0f);
+ var size = new Size(3.0f, 4.0f);
+ theme.AddStyle(styleType.FullName, new ViewStyle() { Position = position, Size = size });
+
+ ThemeManager.ApplyTheme(theme);
+
+ var validStyle = ThemeManager.GetStyle(styleType);
+ var invalidStyle = ThemeManager.GetStyle(typeof(string));
+
+ Assert.IsNotNull(validStyle, "The validStyle should exist.");
+ Assert.IsNull(invalidStyle, "The invalidStyle should not exist.");
+ Assert.IsTrue(position.Equals(validStyle.Position), "Should be equal to the set value.");
+ Assert.IsTrue(size.Equals(validStyle.Size), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test GetStyle with invalid argument.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.GetStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "Type")]
+ public void GetStyle_ARGUMENT_NULL_EXCEPTION_WITH_VIEW_TYPE()
+ {
+ /* TEST CODE */
+ Assert.Throws<ArgumentNullException>(() => {
+ Type nullType = null;
+ var style = ThemeManager.GetStyle(nullType);
+ });
+ }
+ }
+}
Assert.IsTrue(_flag, "Should be true!");
parentActor.ChildRemoved -= viewEventCallback;
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ThemeChangeSensitive. Check whether ThemeChangeSensitive is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.ThemeChangeSensitive A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ThemeChangeSensitive_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ View view = new View();
+ bool testValue = true;
+ view.ThemeChangeSensitive = testValue;
+ Assert.AreEqual(view.ThemeChangeSensitive, testValue, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test BoxShadow. Check whether BoxShadow is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.BoxShadow A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void BoxShadow_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ View view = new View();
+ var blurRadius = 3.2f;
+ var color = Color.White;
+ view.BoxShadow = new Shadow(3.2f, Color.White);
+ Assert.IsNotNull(view.BoxShadow, "BoxShadow should be not null.");
+ Assert.AreEqual(view.BoxShadow.BlurRadius, blurRadius, "Should be equal to the set value");
+ Assert.IsTrue(color.Equals(view.BoxShadow.Color), "Should be equal to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CornerRadius. Check whether CornerRadius is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.CornerRadius A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void CornerRadius_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ View view = new View();
+ var testValue = new Vector4(1.1f, 2.2f, 3.3f, 4.4f);
+ view.CornerRadius = testValue;
+ Assert.IsNotNull(view.CornerRadius, "CornerRadius should be not null.");
+ Assert.IsTrue(testValue.Equals(view.CornerRadius), "Should be equal to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CornerRadiusPolicy. Check whether CornerRadiusPolicy is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.View.CornerRadiusPolicy A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void CornerRadiusPolicy_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ View view = new View();
+ var testValue = VisualTransformPolicyType.Relative;
+ view.CornerRadiusPolicy = testValue;
+ Assert.AreEqual(testValue, view.CornerRadiusPolicy, "Should be equal to the set value");
+ }
}
}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.BaseComponents.ViewStyle Tests")]
+ public class ViewStyleTests
+ {
+ private string TAG = "Test for ViewStyle.cs";
+ private ViewStyle style;
+
+ class ExtentedViewStyle : ViewStyle
+ {
+ public bool explicitDispose = false;
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ explicitDispose = true;
+ }
+
+ base.Dispose(disposing);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, " Init() is called!");
+ style = new ViewStyle();
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, " Destroy() is called!");
+ style = null;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ViewStyle empty constructor.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.ViewStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ViewStyle_INIT()
+ {
+ /* TEST CODE */
+ var viewStyle = new ViewStyle();
+ Assert.IsNotNull(viewStyle, "Should be not null");
+ Assert.IsInstanceOf<ViewStyle>(viewStyle, "Should return ViewStyle instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test BackgroundImage. Check whether BackgroundImage is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.BackgroundImage A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void BackgroundImage_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ Selector<string> testValue = "test.png";
+ style.BackgroundImage = testValue;
+ Assert.IsNotNull(style.BackgroundImage, "Should be not null");
+ Assert.IsTrue(testValue.Equals(style.BackgroundImage), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Opacity. Check whether Opacity is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.Opacity A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Opacity_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ // float? testValue = 10.0f;
+ Selector<float?> testValue = 10.0f;
+ style.Opacity = testValue;
+ Assert.IsNotNull(style.Opacity, "Should be not null");
+ Assert.IsTrue(testValue.Equals(style.Opacity), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test PositionUsesPivotPoint. Check whether PositionUsesPivotPoint is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.PositionUsesPivotPoint A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void PositionUsesPivotPoint_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ bool? testValue = false;
+ style.PositionUsesPivotPoint = testValue;
+ Assert.AreEqual(testValue, style.PositionUsesPivotPoint, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ParentOrigin. Check whether ParentOrigin is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.ParentOrigin A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void ParentOrigin_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = ParentOrigin.Center;
+ style.ParentOrigin = testValue;
+ Assert.IsNotNull(style.ParentOrigin, "Should be not null");
+ Assert.IsTrue(testValue.EqualTo(style.ParentOrigin), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test PivotPoint. Check whether PivotPoint is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.PivotPoint A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void PivotPoint_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = PivotPoint.Center;
+ style.PivotPoint = testValue;
+ Assert.IsNotNull(style.PivotPoint, "Should be not null");
+ Assert.IsTrue(testValue.EqualTo(style.PivotPoint), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SizeWidth. Check whether SizeWidth is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.SizeWidth A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void SizeWidth_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ float? testValue = 10.5f;
+ style.SizeWidth = testValue;
+ Assert.AreEqual(testValue, style.SizeWidth, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SizeHeight. Check whether SizeHeight is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.SizeHeight A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void SizeHeight_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ float? testValue = 20.0f;
+ style.SizeHeight = testValue;
+ Assert.AreEqual(testValue, style.SizeHeight, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Position. Check whether Position is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.Position A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Position_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Position(10.0f, 5.2f, 7.0f);
+ style.Position = testValue;
+ Assert.IsNotNull(style.Position, "Should be not null");
+ Assert.AreEqual(testValue.X, style.Position.X, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Y, style.Position.Y, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Z, style.Position.Z, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SizeModeFactor. Check whether SizeModeFactor is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.SizeModeFactor A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void SizeModeFactor_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Vector3(1.0f, 0.5f, 2.0f);
+ style.SizeModeFactor = testValue;
+ Assert.IsNotNull(style.SizeModeFactor, "Should be not null");
+ Assert.AreEqual(testValue.Width, style.SizeModeFactor.Width, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Height, style.SizeModeFactor.Height, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Depth, style.SizeModeFactor.Depth, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test WidthResizePolicy. Check whether WidthResizePolicy is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.WidthResizePolicy A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void WidthResizePolicy_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = ResizePolicyType.FillToParent;
+ style.WidthResizePolicy = testValue;
+ Assert.AreEqual(testValue, style.WidthResizePolicy, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test HeightResizePolicy. Check whether HeightResizePolicy is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.HeightResizePolicy A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void HeightResizePolicy_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = ResizePolicyType.FillToParent;
+ style.HeightResizePolicy = testValue;
+ Assert.AreEqual(testValue, style.HeightResizePolicy, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Padding. Check whether Padding is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.Padding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Padding_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Extents(1, 2, 3, 4);
+ style.Padding = testValue;
+ Assert.IsNotNull(style.Padding, "Should be not null");
+ Assert.AreEqual(testValue.Start, style.Padding.Start, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.End, style.Padding.End, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Top, style.Padding.Top, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Bottom, style.Padding.Bottom, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test MinimumSize. Check whether MinimumSize is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.MinimumSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void MinimumSize_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Size2D(10, 5);
+ style.MinimumSize = testValue;
+ Assert.IsNotNull(style.MinimumSize, "Should be not null");
+ Assert.AreEqual(testValue.Width, style.MinimumSize.Width, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Height, style.MinimumSize.Height, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test MaximumSize. Check whether MaximumSize is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.MaximumSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void MaximumSize_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Size2D(10, 5);
+ style.MaximumSize = testValue;
+ Assert.IsNotNull(style.MaximumSize, "Should be not null");
+ Assert.AreEqual(testValue.Width, style.MaximumSize.Width, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Height, style.MaximumSize.Height, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Size. Check whether Size is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.Size A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Size_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Size(10.0f, 5.2f, 7.0f);
+ style.Size = testValue;
+ Assert.IsNotNull(style.Size, "Should be not null");
+ Assert.AreEqual(testValue.Width, style.Size.Width, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Height, style.Size.Height, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Depth, style.Size.Depth, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Margin. Check whether Margin is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.Margin A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Margin_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = new Extents(1, 2, 3, 4);
+ style.Margin = testValue;
+ Assert.IsNotNull(style.Margin, "Should be not null");
+ Assert.AreEqual(testValue.Start, style.Margin.Start, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.End, style.Margin.End, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Top, style.Margin.Top, "Should be equal to the set value.");
+ Assert.AreEqual(testValue.Bottom, style.Margin.Bottom, "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test BackgroundColor. Check whether BackgroundColor is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.BackgroundColor A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void BackgroundColor_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ Selector<Color> testValue = new Color(0.0f, 1.0f, 0.5f, 1.0f);
+ style.BackgroundColor = testValue;
+ Assert.IsNotNull(style.BackgroundColor, "Should be not null");
+ Assert.IsTrue(testValue.Equals(style.BackgroundColor), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test BoxShadow. Check whether BoxShadow is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.BoxShadow A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void BoxShadow_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ Selector<Shadow> testValue = new Shadow(10.0f, new Color(0.0f, 1.0f, 0.5f, 1.0f), new Vector2(5.0f, 6.0f), new Vector2(7.0f, 8.0f));
+ style.BoxShadow = testValue;
+ Assert.IsNotNull(style.BoxShadow, "Should be not null");
+ Assert.IsTrue(testValue.Equals(style.BoxShadow), "Should be equal to the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CornerRadiusPolicy. Check whether CornerRadiusPolicy is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.CornerRadiusPolicy A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void CornerRadiusPolicy_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var testValue = VisualTransformPolicyType.Relative;
+ style.CornerRadiusPolicy = testValue;
+ Assert.AreEqual(testValue, style.CornerRadiusPolicy, "Should be equal to the set value.");
+ }
+
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Dispose, try to dispose the ViewStyle.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ViewStyle.Dispose M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ public void Dispose_CHECK_STATUS()
+ {
+ /* TEST CODE */
+ try
+ {
+ ViewStyle viewStyle = new ViewStyle();
+ viewStyle.Dispose();
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test protected Dispose with disposing argument, try to dispose the ViewStyle.")]
+ [Property("SPEC", " Tizen.NUI.BaseComponents.ViewStyle.Dispose M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+ [Property("COVPARAM", "bool")]
+ public void Dispose_CHECK_STATUS_WITH_DISPOSING()
+ {
+ /* TEST CODE */
+ var extentedViewStyle = new ExtentedViewStyle();
+
+ // When Dispose() called, protected Dispose(bool disposing) should be called.
+ extentedViewStyle.Dispose();
+
+ // Check wether Dispose(bool disposing) was called or not.
+ Assert.IsTrue(extentedViewStyle.explicitDispose, "Dispose with disposing argument should have been called.");
+ }
+ }
+}