using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Tizen.NUI.Components.Test;
-
+using Tizen.NUI.BaseComponents;\r
+\r
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
private static bool _themeFlag = false;
private static bool _measureTextFlag = false;
private static bool _layoutChildFlag = false;
+ private static bool _flagGetViewStyle = false;
+ private static bool _flagOnThemeChangedEvent = false;
[SetUp]
public void Init()
/* TEST CODE */
var button = new Components.Button();
Assert.IsNotNull(button, "Should be not null");
- Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be an instance of Button!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Button constructor using string. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.Button C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Button_INIT_WITH_STRING()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultButton", "default", typeof(DefaultButtonStyle));
+ var button = new Button("defaultButton");
+ Assert.IsNotNull(button, "Should be not null!");
+ Assert.IsInstanceOf<Button>(button, "Should be an instance of Button!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Button constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.Button C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ButtonStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Button_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
+ var button = new Button(style);
+ Assert.IsNotNull(button, "Should be not null!");
+ Assert.IsInstanceOf<Button>(button, "Should be an instance of Button!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Style. Check whether Style is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.Style A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Style_CHECK_GET_VALUE()
+ {
+ /* TEST CODE */
+ var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be an instance of Button!");
+
+ var style = button.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
}
[Test]
}
}
+ [Test]
+ [Category("P1")]
+ [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.ApplyStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ApplyStyle_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var button = new Button();
+ var style = new ButtonStyle();
+ button.ApplyStyle(style);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagGetViewStyle = false;
+ var button = new MyButton();
+ var style = button.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OnThemeChangedEvent M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagOnThemeChangedEvent = false;
+ StyleManager.Instance.Theme = "Family";
+ var button = new Button();
+ StyleManager.Instance.Theme = "Food";
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
private void OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args)
{
_stateChangedEvent = true;
}
+ public class MyButton : Button
+ {
+ public MyButton () : base() {}
+
+ protected override ViewStyle GetViewStyle()
+ {
+ _flagGetViewStyle = true;
+ return base.GetViewStyle();
+ }
+
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+ {
+ _flagOnThemeChangedEvent = true;
+ }
+ }
+
+ public class DefaultButtonStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new ButtonStyle();\r
+ }\r
+ }
}
}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.ButtonStyle Tests")]
+ public class ButtonStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ButtonStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ButtonStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.ButtonStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ButtonStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ButtonStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.ButtonStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ButtonStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ButtonStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new ButtonStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<ButtonStyle>(style1, "Should be an instance of ButtonStyle!");
+
+ var style2 = new ButtonStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<ButtonStyle>(style2, "Should be an instance of ButtonStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Overlay. Check whether Overlay is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.Overlay A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Overlay_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.Overlay = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Overlay.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Text. Check whether Text is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.Text A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Text_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.Text = new TextLabelStyle() {Text = "test"};
+ Assert.AreEqual("test", style.Text.Text.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Icon. Check whether Icon is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.Icon A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Icon_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.Icon = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Icon.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsSelectable. Check whether IsSelectable is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.IsSelectable A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void IsSelectable_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.IsSelectable = true;
+ Assert.AreEqual(true, style.IsSelectable, "Should be equals to the set value");
+ style.IsSelectable = false;
+ Assert.AreEqual(false, style.IsSelectable, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsSelected. Check whether IsSelected is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.IsSelected A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void IsSelected_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.IsSelected = true;
+ Assert.AreEqual(true, style.IsSelected, "Should be equals to the set value");
+ style.IsSelected = false;
+ Assert.AreEqual(false, style.IsSelected, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsEnabled. Check whether IsEnabled is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void IsEnabled_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.IsEnabled = true;
+ Assert.AreEqual(true, style.IsEnabled, "Should be equals to the set value");
+ style.IsEnabled = false;
+ Assert.AreEqual(false, style.IsEnabled, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IconRelativeOrientation. Check whether IconRelativeOrientation is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.IconRelativeOrientation A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void IconRelativeOrientation_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.IconRelativeOrientation = Button.IconOrientation.Top;
+ Assert.AreEqual(Button.IconOrientation.Top, style.IconRelativeOrientation, "Should be equals to the set value");
+ style.IconRelativeOrientation = Button.IconOrientation.Left;
+ Assert.AreEqual(Button.IconOrientation.Left, style.IconRelativeOrientation, "Should be equals to the set value");
+ style.IconRelativeOrientation = Button.IconOrientation.Bottom;
+ Assert.AreEqual(Button.IconOrientation.Bottom, style.IconRelativeOrientation, "Should be equals to the set value");
+ style.IconRelativeOrientation = Button.IconOrientation.Right;
+ Assert.AreEqual(Button.IconOrientation.Right, style.IconRelativeOrientation, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IconPadding. Check whether IconPadding is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.IconPadding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void IconPadding_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.IconPadding = new Extents(1,2,3,4);
+ Assert.AreEqual(1, style.IconPadding.Start, "Should be equals to the set value");
+ Assert.AreEqual(2, style.IconPadding.End, "Should be equals to the set value");
+ Assert.AreEqual(3, style.IconPadding.Top, "Should be equals to the set value");
+ Assert.AreEqual(4, style.IconPadding.Bottom, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TextPadding. Check whether TextPadding is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.TextPadding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TextPadding_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ButtonStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be equal!");
+ style.TextPadding = new Extents(1,2,3,4);
+ Assert.AreEqual(1, style.TextPadding.Start, "Should be equals to the set value");
+ Assert.AreEqual(2, style.TextPadding.End, "Should be equals to the set value");
+ Assert.AreEqual(3, style.TextPadding.Top, "Should be equals to the set value");
+ Assert.AreEqual(4, style.TextPadding.Bottom, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new ButtonStyle();
+ var style2 = new ButtonStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
public class LoadingTests
{
private const string TAG = "Components";
+ private static bool _flagGetViewStyle = false;
[SetUp]
public void Init()
Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading type.");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Loading constructor using string. Check whether Loading is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Loading.Loading C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Loading_INIT_WITH_STRING()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultLoading", "default", typeof(DefaultLoadingStyle));
+ var loading = new Loading("defaultLoading");
+ Assert.IsNotNull(loading, "Should be not null!");
+ Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Loading constructor using style. Check whether Loading is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Loading.Loading C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "LoadingStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Loading_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style = new LoadingStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<LoadingStyle>(style, "Should be an instance of LoadingStyle!");
+
+ var loading = new Loading(style);
+ Assert.IsNotNull(loading, "Should be not null!");
+ Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Style. Check whether Style is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Loading.Style A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]
+ public void Style_CHECK_GET_VALUE()
+ {
+ /* TEST CODE */
+ var loading = new Loading();
+ Assert.IsNotNull(loading, "Should be not null");
+ Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading!");
+
+ var style = loading.Style;
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsInstanceOf<LoadingStyle>(style, "Should be an instance of LoadingStyle!");
+ }
+
[Test]
[Category("P1")]
[Description("Test ImageArray. Check whether ImageArray works or not.")]
Assert.Fail("Caught Exception" + e.ToString());
}
}
- }
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Loading.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagGetViewStyle = false;
+ var loading = new MyLoading();
+ var style = loading.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ public class MyLoading : Loading
+ {
+ public MyLoading() : base() {}
+
+ protected override ViewStyle GetViewStyle()
+ {
+ _flagGetViewStyle = true;
+ return base.GetViewStyle();
+ }
+ }
+
+ public class DefaultLoadingStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new LoadingStyle();\r
+ }\r
+ }
+ }
}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.LoadingStyle Tests")]
+ public class LoadingStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("LoadingStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test LoadingStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.LoadingStyle.LoadingStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void LoadingStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new LoadingStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<LoadingStyle>(style, "Should be an instance of LoadingStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test LoadingStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.LoadingStyle.LoadingStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "LoadingStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void LoadingStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new LoadingStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<LoadingStyle>(style1, "Should be an instance of LoadingStyle!");
+
+ var style2 = new LoadingStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<LoadingStyle>(style2, "Should be an instance of LoadingStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Images. Check whether Images is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.LoadingStyle.Images A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Images_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new LoadingStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<LoadingStyle>(style, "Should be equal!");
+ style.Images = new string[] {"test.png"};
+ Assert.AreEqual("test.png", style.Images[0], "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test LoadingSize. Check whether LoadingSize is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.LoadingStyle.LoadingSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void LoadingSize_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new LoadingStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<LoadingStyle>(style, "Should be equal!");
+ style.LoadingSize = new Size(30,20);
+ Assert.AreEqual(30, style.LoadingSize.Width, "Should be equals to the set value");
+ Assert.AreEqual(20, style.LoadingSize.Height, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test FrameRate. Check whether FrameRate is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.LoadingStyle.FrameRate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void FrameRate_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new LoadingStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<LoadingStyle>(style, "Should be equal!");
+ style.FrameRate = 30;
+ Assert.AreEqual(30, style.FrameRate.All, "Should be equals to the set value");
+ style.FrameRate = 60;
+ Assert.AreEqual(60, style.FrameRate.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.LoadingStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new LoadingStyle();
+ var style2 = new LoadingStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.UIComponents;\r
+using Tizen.NUI.Components;\r
+using Tizen.NUI.BaseComponents;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
using Tizen.NUI.Components.Test;\r
\r
namespace Tizen.NUI.Components.Tests\r
private static bool _updateFlag = false;\r
private static bool _layoutChildFlag = false;\r
private static bool _themeFlag = false;\r
+ private static bool _flagGetViewStyle = false;\r
+ private static bool _flagOnThemeChangedEvent = false;\r
\r
[SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("CommonPopupTests");
- App.MainTitleChangeBackgroundColor(null);
-
+ public void Init()\r
+ {\r
+ Tizen.Log.Info(TAG, "Init() is called!");\r
+ App.MainTitleChangeText("CommonPopupTests");\r
+ App.MainTitleChangeBackgroundColor(null);\r
+\r
}\r
\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ Tizen.Log.Info(TAG, "Destroy() is called!");\r
}\r
\r
- [Test]
- [Category("P1")]
- [Description("Test Popup empty constructor. Check it has been triggered")]
- [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
- public void Popup_CHECK_VALUE()
- {
- /* TEST CODE */
- var popup = new Components.Popup();
- Assert.IsNotNull(popup, "Should be not Null!");
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Popup empty constructor. Check it has been triggered")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "")]\r
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
+ public void Popup_CHECK_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");\r
Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
}\r
\r
- [Test]
- [Category("P1")]
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Popup constructor using string. Check whether Popup is successfully created or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Popup_INIT_WITH_STRING()\r
+ {\r
+ /* TEST CODE */\r
+ StyleManager.Instance.Theme = "default";\r
+ StyleManager.Instance.RegisterStyle("defaultPopup", "default", typeof(DefaultPopupStyle));\r
+ var popup = new Popup("defaultPopup");\r
+ Assert.IsNotNull(popup, "Should be not null!");\r
+ Assert.IsInstanceOf<Popup>(popup, "Should be an instance of Popup!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Popup constructor using style. Check whether Popup is successfully created or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "PopupStyle")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Popup_INIT_WITH_STYLE()\r
+ {\r
+ /* TEST CODE */\r
+ var style = new PopupStyle();\r
+ Assert.IsNotNull(style, "Should be not null!");\r
+ Assert.IsInstanceOf<PopupStyle>(style, "Should be an instance of PopupStyle!");\r
+\r
+ var popup = new Popup(style);\r
+ Assert.IsNotNull(popup, "Should be not null!");\r
+ Assert.IsInstanceOf<Popup>(popup, "Should be an instance of Popup!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Style. Check whether Style is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.Style A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Style_CHECK_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var popup = new Popup();\r
+ Assert.IsNotNull(popup, "Should be not null");\r
+ Assert.IsInstanceOf<Popup>(popup, "Should be an instance of Popup!");\r
+\r
+ var style = popup.Style;\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsInstanceOf<PopupStyle>(style, "Should be an instance of PopupStyle!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
[Description("Test TitleText. Check whether TitleText is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitleText A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void TitleText_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.TitleText = "Test TitleText";\r
Assert.AreEqual("Test TitleText", popup.TitleText, "Should be equals to the set value of TitleText");\r
}\r
[Description("Test ButtonCount. Check whether ButtonCount is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ButtonCount A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ButtonCount_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.ButtonCount = 2;\r
Assert.AreEqual(2, popup.ButtonCount, "Should be equals to the set value of ButtonCount");\r
}\r
[Description("Test ContentView. Check whether ContentView is readable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ContentView A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRO")]
+ [Property("CRITERIA", "PRO")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ContentView_GET_VALUE()\r
{\r
[Description("Test TitlePointSize. Check whether TitlePointSize is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitlePointSize A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void TitlePointSize_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.TitlePointSize = 10.0f;\r
Assert.AreEqual(10.0f, popup.TitlePointSize, "Should be equals to the set value of TitlePointSize");\r
}\r
[Description("Test TitleTextColor. Check whether TitleTextColor is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextColor A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void TitleTextColor_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
var color = new Color(1.0f, 0.0f, 0.0f, 1.0f);\r
- Assert.IsNotNull(color, "Should be not Null!");
- Assert.IsInstanceOf<Color>(color, "Should be equal!");
+ Assert.IsNotNull(color, "Should be not Null!");\r
+ Assert.IsInstanceOf<Color>(color, "Should be equal!");\r
popup.TitleTextColor = color;\r
\r
- Assert.AreEqual(color.R, popup.TitleTextColor.R, "Should be equals to the color.R set");
- Assert.AreEqual(color.G, popup.TitleTextColor.G, "Should be equals to the color.G set");
- Assert.AreEqual(color.B, popup.TitleTextColor.B, "Should be equals to the color.B set");
+ Assert.AreEqual(color.R, popup.TitleTextColor.R, "Should be equals to the color.R set");\r
+ Assert.AreEqual(color.G, popup.TitleTextColor.G, "Should be equals to the color.G set");\r
+ Assert.AreEqual(color.B, popup.TitleTextColor.B, "Should be equals to the color.B set");\r
Assert.AreEqual(color.A, popup.TitleTextColor.A, "Should be equals to the color.A set");\r
\r
}\r
[Description("Test TitleTextHorizontalAlignment. Check whether TitleTextHorizontalAlignment is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextHorizontalAlignment A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void TitleTextHorizontalAlignment_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin;\r
Assert.AreEqual(HorizontalAlignment.Begin, popup.TitleTextHorizontalAlignment, "Should be equals to the set value of TitleTextHorizontalAlignment");\r
}\r
[Description("Test TitleTextPosition. Check whether TitleTextPosition is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextPosition A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void TitleTextPosition_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.TitleTextPosition = new Position(10, 10);\r
\r
Assert.AreEqual(10, popup.TitleTextPosition.X, "Should be equal");\r
[Description("Test TitleHeight. Check whether TitleHeight is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitleHeight A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void TitleHeight_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.TitleHeight = 10;\r
Assert.AreEqual(10, popup.TitleHeight, "Should be equals to the set value of TitleHeight");\r
}\r
[Description("Test ButtonHeight. Check whether ButtonHeight is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ButtonHeight A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ButtonHeight_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.ButtonHeight = 10;\r
Assert.AreEqual(10, popup.ButtonHeight, "Should be equals to the set value of ButtonHeight");\r
}\r
[Description("Test ButtonTextPointSize. Check whether ButtonTextPointSize is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextPointSize A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ButtonTextPointSize_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.ButtonTextPointSize = 10.0f;\r
Assert.AreEqual(10.0f, popup.ButtonTextPointSize, "Should be equals to the set value of ButtonTextPointSize");\r
}\r
[Description("Test ButtonFontFamily. Check whether ButtonFontFamily is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ButtonFontFamily A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ButtonFontFamily_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.ButtonFontFamily = "SamsungOne 500";\r
Assert.AreEqual("SamsungOne 500", popup.ButtonFontFamily, "Should be equals to the set value of ButtonFontFamily");\r
}\r
[Description("Test ButtonTextAlignment. Check whether ButtonTextAlignment is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextAlignment A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ButtonTextAlignment_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
popup.ButtonTextAlignment = HorizontalAlignment.Begin;\r
Assert.AreEqual(HorizontalAlignment.Begin, popup.ButtonTextAlignment, "Should be equal");\r
}\r
[Description("Test ButtonTextColor. Check whether ButtonTextColor is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextColor A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void ButtonTextColor_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
-
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+\r
var textColor = new Color(0.0f, 0.0f, 1.0f, 0.0f);\r
- Assert.IsNotNull(textColor, "Should be not Null!");
- Assert.IsInstanceOf<Color>(textColor, "Should be equal!");
+ Assert.IsNotNull(textColor, "Should be not Null!");\r
+ Assert.IsInstanceOf<Color>(textColor, "Should be equal!");\r
popup.ButtonTextColor = textColor;\r
\r
Assert.AreEqual(textColor.R, popup.ButtonTextColor.R, "Should be equal");\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test SetButtonText. Check it has been triggered")]
- [Property("SPEC", "Tizen.NUI.Components.Popup.SetButtonText M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
- public void SetButtonText_CHECK_VALUE()
- {
+ [Description("Test SetButtonText. Check it has been triggered")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.SetButtonText M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MCST")]\r
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
+ public void SetButtonText_CHECK_VALUE()\r
+ {\r
/* TEST CODE */\r
- try
- {
- Popup popup = new Popup();
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
- popup.SetButtonText(0, "YES");
- }
- catch (Exception e)
- {
- Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ try\r
+ {\r
+ Popup popup = new Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+ popup.SetButtonText(0, "YES");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());\r
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Dispose, try to dispose the Popup.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.Dispose M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MCST")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Dispose_TEST()\r
+ {\r
+ /* TEST CODE */\r
+ try\r
+ {\r
+ Popup popup = new Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");\r
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
+ popup.Dispose();\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());\r
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test AddButton. Check whether AddButton works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.AddButton M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("COVPARAM", "string, string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void AddButton_WITH_STRING_STRING()\r
+ {\r
+ try\r
+ {\r
+ var popup = new Popup();\r
+ var style = new ButtonStyle();\r
+ popup.AddButton("button1", "button");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test AddButton. Check whether AddButton works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.AddButton M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("COVPARAM", "string, ButtonStyle")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void AddButton_WITH_STRING_STYLE()\r
+ {\r
+ try\r
+ {\r
+ var popup = new Popup();\r
+ var style = new ButtonStyle();\r
+ popup.AddButton("button1", style);\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.ApplyStyle M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ApplyStyle_NO_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ var popup = new Popup();\r
+ var style = new ButtonStyle();\r
+ popup.ApplyStyle(style);\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
}\r
+ }\r
\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.GetViewStyle M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void GetViewStyle_CHECK_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ _flagGetViewStyle = false;\r
+ var popup = new MyPopup();\r
+ var style = popup.Style;\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
}\r
\r
- [Test]
- [Category("P1")]
- [Description("Test Dispose, try to dispose the Popup.")]
- [Property("SPEC", "Tizen.NUI.Components.Popup.Dispose M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
- public void Dispose_TEST()
- {
- /* TEST CODE */
- try
- {
- Popup popup = new Popup();
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
- popup.Dispose();
- }
- catch (Exception e)
- {
- Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
- }
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.OnThemeChangedEvent M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ _flagOnThemeChangedEvent = false;\r
+ StyleManager.Instance.Theme = "Family";\r
+ var popup = new MyPopup();\r
+ StyleManager.Instance.Theme = "Food";\r
+ Assert.IsNotNull(popup, "Should be not null");\r
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ public class MyPopup : Popup\r
+ {\r
+ public MyPopup () : base() {}\r
+\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ _flagGetViewStyle = true;\r
+ return base.GetViewStyle();\r
+ }\r
+\r
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)\r
+ {\r
+ _flagOnThemeChangedEvent = true;\r
+ }\r
+ }\r
+\r
+ public class DefaultPopupStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new PopupStyle();\r
+ }\r
+ }\r
}\r
}\r
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.PopupStyle Tests")]
+ public class PopupStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("PopupStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test PopupStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.PopupStyle.PopupStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void PopupStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new PopupStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<PopupStyle>(style, "Should be an instance of PopupStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test PopupStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.PopupStyle.PopupStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "PopupStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void PopupStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new PopupStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<PopupStyle>(style1, "Should be an instance of PopupStyle!");
+
+ var style2 = new PopupStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<PopupStyle>(style2, "Should be an instance of PopupStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Buttons. Check whether Buttons is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.PopupStyle.Buttons A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Buttons_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new PopupStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<PopupStyle>(style, "Should be equal!");
+ style.Buttons = new ButtonStyle() {IsSelected = true};
+ Assert.AreEqual(true, style.Buttons.IsSelected, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Title. Check whether Title is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.PopupStyle.Title A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Title_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new PopupStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<PopupStyle>(style, "Should be equal!");
+ style.Title = new TextLabelStyle() {Text = "test"};
+ Assert.AreEqual("test", style.Title.Text.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.PopupStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new PopupStyle();
+ var style2 = new PopupStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
using System.Threading;
using System.Threading.Tasks;
using Tizen.NUI.Components.Test;
-
+using Tizen.NUI.BaseComponents;\r
+\r
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
{
private const string TAG = "Components";
private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Components.Tests.png";
+ private static bool _flagGetViewStyle = false;
+ private static bool _flagOnThemeChangedEvent = false;
[SetUp]
public void Init()
[Test]
[Category("P1")]
+ [Description("Test Progress constructor using string. Check whether Progress is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Progress.Progress C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Progress_INIT_WITH_STRING()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultProgress", "default", typeof(DefaultProgressStyle));
+ var progress = new Progress("defaultProgress");
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Should be an instance of Progress!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Progress constructor using style. Check whether Progress is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Progress.Progress C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ProgressStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Progress_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style = new ProgressStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ProgressStyle>(style, "Should be an instance of ProgressStyle!");
+
+ var progress = new Progress(style);
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Should be an instance of Progress!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Style. Check whether Style is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Progress.Style A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]
+ public void Style_CHECK_GET_VALUE()
+ {
+ /* TEST CODE */
+ var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null");
+ Assert.IsInstanceOf<Progress>(progress, "Should be an instance of Progress!");
+
+ var style = progress.Style;\r
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ProgressStyle>(style, "Should be an instance of ProgressStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Test TrackImageURL. Check whether TrackImageURL works or not.")]
[Property("SPEC", "Tizen.NUI.Components.Progress.TrackImageURL A")]
[Property("SPEC_URL", "-")]
Assert.Fail("Caught Exception" + e.ToString());
}
}
- }
- public class MyProgress : Progress
- {
- public MyProgress() : base()
- { }
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Progress.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagGetViewStyle = false;
+ var progress = new MyProgress();
+ var style = progress.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Progress.OnThemeChangedEvent M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagOnThemeChangedEvent = false;
+ StyleManager.Instance.Theme = "Family";
+ var progress = new MyProgress();
+ StyleManager.Instance.Theme = "Food";
+ Assert.IsNotNull(progress, "Should be not null");
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
- public void _ChangeImageState(ProgressStatusType statusType)
+ public class MyProgress : Progress
{
- base.ChangeImageState(statusType);
+ public MyProgress() : base()
+ { }
+
+ public void _ChangeImageState(ProgressStatusType statusType)
+ {
+ base.ChangeImageState(statusType);
+ }
+
+ protected override ViewStyle GetViewStyle()
+ {
+ _flagGetViewStyle = true;
+ return base.GetViewStyle();
+ }
+
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+ {
+ _flagOnThemeChangedEvent = true;
+ }
+ }
+
+ public class DefaultProgressStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new ProgressStyle();\r
+ }\r
}
}
}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.ProgressStyle Tests")]
+ public class ProgressStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ProgressStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ProgressStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ProgressStyle.ProgressStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ProgressStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new ProgressStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ProgressStyle>(style, "Should be an instance of ProgressStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ProgressStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ProgressStyle.ProgressStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ProgressStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ProgressStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new ProgressStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<ProgressStyle>(style1, "Should be an instance of ProgressStyle!");
+
+ var style2 = new ProgressStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<ProgressStyle>(style2, "Should be an instance of ProgressStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Track. Check whether Track is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ProgressStyle.Track A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Track_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ProgressStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ProgressStyle>(style, "Should be equal!");
+ style.Track = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Track.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Progress. Check whether Progress is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ProgressStyle.Progress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Progress_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ProgressStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ProgressStyle>(style, "Should be equal!");
+ style.Progress = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Progress.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Buffer. Check whether Buffer is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ProgressStyle.Buffer A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Buffer_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ProgressStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ProgressStyle>(style, "Should be equal!");
+ style.Buffer = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Buffer.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.ProgressStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new ProgressStyle();
+ var style2 = new ProgressStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
private const string TAG = "NUI.Components";\r
private string _style = "";\r
private string _trackImageUrl = "";\r
+ private static bool _flagGetViewStyle = false;\r
+ private static bool _flagOnThemeChangedEvent = false;\r
\r
[SetUp]\r
public void Init()\r
\r
[Test]\r
[Category("P1")]\r
+ [Description("Test ScrollBar constructor using string. Check whether ScrollBar is successfully created or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ScrollBar_INIT_WITH_STRING()\r
+ {\r
+ /* TEST CODE */\r
+ StyleManager.Instance.Theme = "default";\r
+ StyleManager.Instance.RegisterStyle("defaultScrollBar", "default", typeof(DefaultScrollBarStyle));\r
+ var scrollBar = new ScrollBar("defaultScrollBar");\r
+ Assert.IsNotNull(scrollBar, "Should be not null!");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test ScrollBar constructor using style. Check whether ScrollBar is successfully created or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "ScrollBarStyle")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ScrollBar_INIT_WITH_STYLE()\r
+ {\r
+ /* TEST CODE */\r
+ var style = new ScrollBarStyle();\r
+ Assert.IsNotNull(style, "Should be not null!");\r
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be an instance of ScrollBarStyle!");\r
+\r
+ var scrollBar = new ScrollBar(style);\r
+ Assert.IsNotNull(scrollBar, "Should be not null!");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Style. Check whether Style is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.Style A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Style_CHECK_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Should be not null");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar!");\r
+\r
+ var style = scrollBar.Style;\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be an instance of ScrollBarStyle!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
[Description("Test MinValue.Check whether MinValue is readable ahd writeable.")]\r
[Property("SPEC", "Tizen.NUI.Components.ScrollBar.MinValue A")]\r
[Property("SPEC_URL", "-")]\r
Assert.AreEqual(50, scrollBar.CurrentValue, "Should be equals to the set value of CurrentValue.");\r
}\r
\r
- [Test]
- [Category("P1")]
- [Description("Test Dispose, try to dispose the ScrollBar.")]
- [Property("SPEC", "Tizen.NUI.Components.ScrollBar.Dispose M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
- public void Dispose_TEST()
- {
- /* TEST CODE */
- try
- {
- var scrollBar = new ScrollBar();
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Dispose, try to dispose the ScrollBar.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.Dispose M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MCST")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Dispose_TEST()\r
+ {\r
+ /* TEST CODE */\r
+ try\r
+ {\r
+ var scrollBar = new ScrollBar();\r
Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
\r
- scrollBar.Dispose();
- }
- catch (Exception e)
- {
- Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
+ scrollBar.Dispose();\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());\r
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.GetViewStyle M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void GetViewStyle_CHECK_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ _flagGetViewStyle = false;\r
+ var scrollBar = new MyScrollBar();\r
+ var style = scrollBar.Style;\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.OnThemeChangedEvent M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ _flagOnThemeChangedEvent = false;\r
+ StyleManager.Instance.Theme = "Family";\r
+ var scrollBar = new MyScrollBar();\r
+ StyleManager.Instance.Theme = "Food";\r
+ Assert.IsNotNull(scrollBar, "Should be not null");\r
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ public class MyScrollBar : ScrollBar\r
+ {\r
+ public MyScrollBar() : base() {}\r
+\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ _flagGetViewStyle = true;\r
+ return base.GetViewStyle();\r
+ }\r
+\r
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)\r
+ {\r
+ _flagOnThemeChangedEvent = true;\r
+ }\r
+ }\r
+\r
+ public class DefaultScrollBarStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new ScrollBarStyle();\r
+ }\r
}\r
}\r
}\r
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.ScrollBarStyle Tests")]
+ public class ScrollBarStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ScrollBarStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ScrollBarStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.ScrollBarStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ScrollBarStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new ScrollBarStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be an instance of ScrollBarStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ScrollBarStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.ScrollBarStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ScrollBarStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ScrollBarStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new ScrollBarStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<ScrollBarStyle>(style1, "Should be an instance of ScrollBarStyle!");
+
+ var style2 = new ScrollBarStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<ScrollBarStyle>(style2, "Should be an instance of ScrollBarStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Track. Check whether Track is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.Track A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Track_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ScrollBarStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be equal!");
+ style.Track = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Track.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Thumb. Check whether Thumb is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.Thumb A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Thumb_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ScrollBarStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be equal!");
+ style.Thumb = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Thumb.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Direction. Check whether Direction is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.Direction A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Direction_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ScrollBarStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be equal!");
+ style.Direction = ScrollBar.DirectionType.Horizontal;
+ Assert.AreEqual(ScrollBar.DirectionType.Horizontal, style.Direction, "Should be equals to the set value");
+ style.Direction = ScrollBar.DirectionType.Vertical;
+ Assert.AreEqual(ScrollBar.DirectionType.Vertical, style.Direction, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Duration. Check whether Duration is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.Duration A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Duration_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ScrollBarStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ScrollBarStyle>(style, "Should be equal!");
+ style.Duration = 30;
+ Assert.AreEqual(30, style.Duration, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBarStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new ScrollBarStyle();
+ var style2 = new ScrollBarStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
using NUnit.Framework.TUnit;
using System;
using System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;\r
using Tizen.NUI.Components.Test;
namespace Tizen.NUI.Components.Tests
private bool _checkMark;
private const string TAG = "TCT";
private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ private static bool _flagGetViewStyle = false;
+ private static bool _flagOnThemeChangedEvent = false;
+
public SliderTests()
{
_checkValue = false;
[Test]
[Category("P1")]
+ [Description("Test Slider constructor using string. Check whether Slider is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.Slider C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Slider_INIT_WITH_STRING()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultSlider", "default", typeof(DefaultSliderStyle));
+ var slider = new Slider("defaultSlider");
+ Assert.IsNotNull(slider, "Should be not null!");
+ Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Slider constructor using style. Check whether Slider is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.Slider C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "SliderStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Slider_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be an instance of SliderStyle!");
+
+ var slider = new Slider(style);
+ Assert.IsNotNull(slider, "Should be not null!");
+ Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Style. Check whether Style is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.Style A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]
+ public void Style_CHECK_GET_VALUE()
+ {
+ /* TEST CODE */
+ var slider = new Slider();
+ Assert.IsNotNull(slider, "Should be not null");
+ Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider!");
+
+ var style = slider.Style;\r
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be an instance of SliderStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Test Direction. Check Direction works or not.")]
[Property("SPEC", "Tizen.NUI.Components.Slider.Direction A")]
[Property("SPEC_URL", "-")]
Assert.Fail("Caught Exception" + e.ToString());
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.ApplyStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ApplyStyle_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var slider = new Slider();
+ var style = new SliderStyle();
+ slider.ApplyStyle(style);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagGetViewStyle = false;
+ var slider = new MySlider();
+ var style = slider.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.OnThemeChangedEvent M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagOnThemeChangedEvent = false;
+ StyleManager.Instance.Theme = "Family";
+ var slider = new Slider();
+ StyleManager.Instance.Theme = "Food";
+ Assert.IsNotNull(slider, "Should be not null");
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ public class MySlider : Slider
+ {
+ public MySlider () : base() {}
+
+ protected override ViewStyle GetViewStyle()
+ {
+ _flagGetViewStyle = true;
+ return base.GetViewStyle();
+ }
+
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+ {
+ _flagOnThemeChangedEvent = true;
+ }
+ }
+
+ public class DefaultSliderStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new SliderStyle();\r
+ }\r
+ }
}
}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.SliderStyle Tests")]
+ public class SliderStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("SliderStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SliderStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.SliderStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void SliderStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be an instance of SliderStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SliderStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.SliderStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "SliderStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void SliderStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new SliderStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<SliderStyle>(style1, "Should be an instance of SliderStyle!");
+
+ var style2 = new SliderStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<SliderStyle>(style2, "Should be an instance of SliderStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Track. Check whether Track is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.Track A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Track_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.Track = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Track.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Progress. Check whether Progress is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.Progress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Progress_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.Progress = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Progress.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Thumb. Check whether Thumb is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.Thumb A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Thumb_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.Thumb = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Thumb.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test LowIndicatorImage. Check whether LowIndicatorImage is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.LowIndicatorImage A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void LowIndicatorImage_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.LowIndicatorImage = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.LowIndicatorImage.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test HighIndicatorImage. Check whether HighIndicatorImage is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.HighIndicatorImage A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void HighIndicatorImage_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.HighIndicatorImage = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.HighIndicatorImage.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test LowIndicator. Check whether LowIndicator is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.LowIndicator A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void LowIndicator_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.LowIndicator = new TextLabelStyle() {Text = "test"};
+ Assert.AreEqual("test", style.LowIndicator.Text.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test HighIndicator. Check whether HighIndicator is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.HighIndicator A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void HighIndicator_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.HighIndicator = new TextLabelStyle() {Text = "test"};
+ Assert.AreEqual("test", style.HighIndicator.Text.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IndicatorType. Check whether IndicatorType is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.IndicatorType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void IndicatorType_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be an instance of SliderStyle!");
+ style.IndicatorType = Slider.IndicatorType.Image;
+ Assert.AreEqual(Slider.IndicatorType.Image, style.IndicatorType, "Should be equals to the set value");
+ style.IndicatorType = Slider.IndicatorType.Text;
+ Assert.AreEqual(Slider.IndicatorType.Text, style.IndicatorType, "Should be equals to the set value");
+ style.IndicatorType = Slider.IndicatorType.None;
+ Assert.AreEqual(Slider.IndicatorType.None, style.IndicatorType, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TrackThickness. Check whether TrackThickness is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.TrackThickness A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TrackThickness_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.TrackThickness = 30;
+ Assert.AreEqual(30, style.TrackThickness, "Should be equals to the set value");
+ style.TrackThickness = 20;
+ Assert.AreEqual(20, style.TrackThickness, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SpaceBetweenTrackAndIndicator. Check whether SpaceBetweenTrackAndIndicator is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.SpaceBetweenTrackAndIndicator A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void SpaceBetweenTrackAndIndicator_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.SpaceBetweenTrackAndIndicator = 10;
+ Assert.AreEqual(10, style.SpaceBetweenTrackAndIndicator, "Should be equals to the set value");
+ style.SpaceBetweenTrackAndIndicator = 20;
+ Assert.AreEqual(20, style.SpaceBetweenTrackAndIndicator, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TrackPadding. Check whether TrackPadding is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.TrackPadding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TrackPadding_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SliderStyle>(style, "Should be equal!");
+ style.TrackPadding = new Extents(1,2,3,4);
+ Assert.AreEqual(1, style.TrackPadding.Start, "Should be equals to the set value");
+ Assert.AreEqual(2, style.TrackPadding.End, "Should be equals to the set value");
+ Assert.AreEqual(3, style.TrackPadding.Top, "Should be equals to the set value");
+ Assert.AreEqual(4, style.TrackPadding.Bottom, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new SliderStyle();
+ var style2 = new SliderStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.StyleBase Tests")]
+ public class StyleBaseTests
+ {
+ private const string TAG = "Components";
+ private static bool flagGetViewStyle = false;
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("StyleBaseTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test StyleBase empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleBase.StyleBase C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void StyleBase_INIT()
+ {
+ /* TEST CODE */
+ var style = new StyleBase();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<StyleBase>(style, "Should be an instance of StyleBase!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Content. Check whether Content is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleBase.Content A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Content_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new MySliderStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<MySliderStyle>(style, "Should be an instance of MySliderStyle!");
+ var sliderStyle = new SliderStyle();
+ style._Content = (object)sliderStyle;
+ Assert.AreEqual(sliderStyle, style._Content, "Should be equals to the set value");
+ }
+
+ public class MySliderStyle : StyleBase\r
+ {\r
+ public object _Content\r
+ {\r
+ get\r
+ {\r
+ return base.Content;\r
+ }\r
+ set\r
+ {\r
+ base.Content = value;\r
+ }\r
+ }\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ flagGetViewStyle = true;\r
+ return new SliderStyle();\r
+ }\r
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using Tizen.NUI.Components;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs Tests")]
+ public class ThemeChangeEventArgsTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ThemeChangeEventArgsTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a ThemeChangeEventArgs object. Check whether ThemeChangeEventArgs is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs.ThemeChangeEventArgs C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ThemeChangeEventArgs_INIT()
+ {
+ var eventArgs = new StyleManager.ThemeChangeEventArgs();
+ Assert.IsNotNull(eventArgs, "Should be not null!");
+ Assert.IsInstanceOf<StyleManager.ThemeChangeEventArgs>(eventArgs, "Should return ThemeChangeEventArgs instance.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CurrentTheme. Check whether CurrentTheme is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs.CurrentTheme A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CurrentTheme_SET_GET_VALUE()
+ {
+ var eventArgs = new StyleManager.ThemeChangeEventArgs();
+ Assert.IsNotNull(eventArgs, "Should be not null!");
+ Assert.IsInstanceOf<StyleManager.ThemeChangeEventArgs>(eventArgs, "Should return ThemeChangeEventArgs instance.");
+
+ eventArgs.CurrentTheme = "default";
+ Assert.AreEqual("default", eventArgs.CurrentTheme, "Retrieved CurrentTheme should be equal to set value.");
+ }
+ }
+}
+
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.StyleManager Tests")]
+ public class StyleManagerTests
+ {
+ private const string TAG = "Components";
+ private bool flagOnThemeChangedEvent = false;
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("StyleManagerTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }\r
+\r
+ private void OnThemeChangedEvent(object obj, StyleManager.ThemeChangeEventArgs args)
+ {
+ flagOnThemeChangedEvent = true;
+ }
+\r
+ [Test]
+ [Category("P1")]
+ [Description("Test ThemeChangedEvent. Check Event Handler of Value Change.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.ThemeChangedEvent E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ThemeChangedEvent_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+
+ try
+ {
+ flagOnThemeChangedEvent = false;
+ StyleManager.Instance.Theme = "MyFamily";\r
+ StyleManager.Instance.ThemeChangedEvent += OnThemeChangedEvent;\r
+ StyleManager.Instance.Theme = "MyFood";\r
+ Assert.IsTrue(flagOnThemeChangedEvent, "Item change event should received");\r
+ StyleManager.Instance.ThemeChangedEvent -= OnThemeChangedEvent;
+ }
+ catch (Exception e)
+ {
+ Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Instance. Check whether Instance is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.Instance A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Instance_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var manager = StyleManager.Instance;
+ Assert.IsNotNull(manager, "Should be not null");
+ Assert.IsInstanceOf<StyleManager>(manager, "Should be an instance of StyleManager!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Theme. Check whether Theme is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.Theme A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Theme_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "Family";
+ Assert.AreEqual("Family", StyleManager.Instance.Theme, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test RegisterStyle. Check whether RegisterStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterStyle_NO_RETURN_VALUE()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterStyle("MyButtonStyle", "default", typeof(MyButtonStyle));
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("FamilyButton", "default", typeof(MyButtonStyle));
+ var style = StyleManager.Instance.GetViewStyle("FamilyButton");\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test RegisterComponentStyle. Check whether RegisterComponentStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterComponentStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterComponentStyle_NO_RETURN_VALUE()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterComponentStyle("MyButtonStyle1", typeof(Button) ,typeof(MyButtonStyle));
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetComponentStyle. Check whether GetComponentStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.GetComponentStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetComponentStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ StyleManager.Instance.Theme = "FoodButton";
+ StyleManager.Instance.RegisterComponentStyle("FoodButton", typeof(Button), typeof(MyButtonStyle));
+ var style = StyleManager.Instance.GetComponentStyle(typeof(Button));\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ public class MyButtonStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new ButtonStyle();\r
+ }\r
+ }
+ }
+}
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.Components;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.Components;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
using Tizen.NUI.Components.Test;\r
\r
namespace Tizen.NUI.Components.Tests\r
{\r
private const string TAG = "Components";\r
private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
+ private static bool _flagGetViewStyle = false;\r
+ private static bool _flagOnThemeChangedEvent = false;\r
\r
[SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("CommonSwitchTests");
- App.MainTitleChangeBackgroundColor(null);
-
+ public void Init()\r
+ {\r
+ Tizen.Log.Info(TAG, "Init() is called!");\r
+ App.MainTitleChangeText("CommonSwitchTests");\r
+ App.MainTitleChangeBackgroundColor(null);\r
}\r
\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ Tizen.Log.Info(TAG, "Destroy() is called!");\r
}\r
\r
- [Test]
- [Category("P1")]
- [Description("Test Switch empty constructor. Check it has been triggered")]
- [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
- public void Switch_CHECK_VALUE()
- {
- /* TEST CODE */
- var _switch = new Switch();
- Assert.IsNotNull(_switch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Switch empty constructor. Check it has been triggered")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "")]\r
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
+ public void Switch_CHECK_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var _switch = new Switch();\r
+ Assert.IsNotNull(_switch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be an instance of Switch!");\r
+\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Switch constructor using string. Check whether Switch is successfully created or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Switch_INIT_WITH_STRING()\r
+ {\r
+ /* TEST CODE */\r
+ StyleManager.Instance.Theme = "default";\r
+ StyleManager.Instance.RegisterStyle("defaultSwitch", "default", typeof(DefaultSwitchStyle));\r
+ var switch1 = new Switch("defaultSwitch");\r
+ Assert.IsNotNull(switch1, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(switch1, "Should be an instance of Switch!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Switch constructor using style. Check whether Switch is successfully created or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "SwitchStyle")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Switch_INIT_WITH_STYLE()\r
+ {\r
+ /* TEST CODE */\r
+ var style = new SwitchStyle();\r
+ Assert.IsNotNull(style, "Should be not null!");\r
+ Assert.IsInstanceOf<SwitchStyle>(style, "Should be an instance of SwitchStyle!");\r
+\r
+ var _switch = new Switch(style);\r
+ Assert.IsNotNull(_switch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be an instance of Switch!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Style. Check whether Style is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.Style A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Style_CHECK_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var _switch = new Switch();\r
+ Assert.IsNotNull(_switch, "Should be not null");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be an instance of Switch!");\r
\r
+ var style = _switch.Style;\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsInstanceOf<SwitchStyle>(style, "Should be an instance of SwitchStyle!");\r
}\r
\r
- [Test]
- [Category("P1")]
+ [Test]\r
+ [Category("P1")]\r
[Description("Test SwitchBackgroundImageURLSelector. Check whether SwitchBackgroundImageURLSelector is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Switch.SwitchBackgroundImageURLSelector A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void SwitchBackgroundImageURLSelector_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
- Assert.IsNotNull(_switch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
-
+ Assert.IsNotNull(_switch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");\r
+\r
StringSelector stringSelector = new StringSelector\r
{\r
Normal = _image_path,\r
Selected = _image_path,\r
};\r
- Assert.IsNotNull(stringSelector, "Should be not null!");
- Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
-
+ Assert.IsNotNull(stringSelector, "Should be not null!");\r
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");\r
+\r
_switch.SwitchBackgroundImageURLSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, _switch.SwitchBackgroundImageURLSelector.Normal, "Should be equals to the set value of SwitchBackgroundImageURLSelector Normal");\r
Assert.AreEqual(stringSelector.Selected, _switch.SwitchBackgroundImageURLSelector.Selected, "Should be equals to the set value of SwitchBackgroundImageURLSelector Selected");\r
[Description("Test SwitchHandlerImageURL. Check whether SwitchHandlerImageURL is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageURL A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void SwitchHandlerImageURL_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
- Assert.IsNotNull(_switch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
-
+ Assert.IsNotNull(_switch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");\r
+\r
_switch.SwitchHandlerImageURL = _image_path;\r
Assert.AreEqual(_image_path, _switch.SwitchHandlerImageURL, "Should be equals to the set value of SwitchHandlerImageURL");\r
}\r
[Description("Test SwitchHandlerImageURLSelector. Check whether SwitchHandlerImageURLSelector is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageURLSelector A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void SwitchHandlerImageURLSelector_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
- Assert.IsNotNull(_switch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
-
+ Assert.IsNotNull(_switch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");\r
+\r
StringSelector stringSelector = new StringSelector\r
{\r
Normal = _image_path,\r
Selected = _image_path,\r
};\r
- Assert.IsNotNull(stringSelector, "Should be not null!");
- Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
-
+ Assert.IsNotNull(stringSelector, "Should be not null!");\r
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");\r
+\r
_switch.SwitchHandlerImageURLSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, _switch.SwitchHandlerImageURLSelector.Normal, "Should be equals to the set value of SwitchHandlerImageURLSelector Normal");\r
Assert.AreEqual(stringSelector.Selected, _switch.SwitchHandlerImageURLSelector.Selected, "Should be equals to the set value of SwitchHandlerImageURLSelector Selected");\r
[Description("Test SwitchHandlerImageSize. Check whether SwitchHandlerImageSize is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageSize A")]\r
[Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
+ [Property("CRITERIA", "PRW")]\r
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
public void SwitchHandlerImageSize_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
- Assert.IsNotNull(_switch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
-
+ Assert.IsNotNull(_switch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");\r
+\r
_switch.SwitchHandlerImageSize = new Size(10, 10);\r
Assert.AreEqual(10, _switch.SwitchHandlerImageSize.Width, "Should be equals to the set value of SwitchHandlerImageSize2D.Width");\r
Assert.AreEqual(10, _switch.SwitchHandlerImageSize.Height, "Should be equals to the set value of SwitchHandlerImageSize2D.Height");\r
}\r
\r
- [Test]
- [Category("P1")]
- [Description("Test Dispose, try to dispose the Switch.")]
- [Property("SPEC", "Tizen.NUI.Components.Switch.Dispose M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
- public void Dispose_TEST()
- {
- /* TEST CODE */
- try
- {
- var mySwitch = new Switch();
- Assert.IsNotNull(mySwitch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(mySwitch, "Should be equal!");
-
- mySwitch.Dispose();
- }
- catch (Exception e)
- {
- Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Dispose, try to dispose the Switch.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.Dispose M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MCST")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Dispose_TEST()\r
+ {\r
+ /* TEST CODE */\r
+ try\r
+ {\r
+ var mySwitch = new Switch();\r
+ Assert.IsNotNull(mySwitch, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch>(mySwitch, "Should be equal!");\r
+\r
+ mySwitch.Dispose();\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());\r
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.GetViewStyle M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void GetViewStyle_CHECK_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ _flagGetViewStyle = false;\r
+ var _switch = new MySwitch();\r
+ var style = _switch.Style;\r
+ Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.OnThemeChangedEvent M")]\r
+ [Property("SPEC_URL", " - ")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()\r
+ {\r
+ try\r
+ {\r
+ _flagOnThemeChangedEvent = false;\r
+ StyleManager.Instance.Theme = "Family";\r
+ var _switch = new Switch();\r
+ StyleManager.Instance.Theme = "Food";\r
+ Assert.IsNotNull(_switch, "Should be not null");\r
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Assert.Fail("Caught Exception" + e.ToString());\r
+ }\r
+ }\r
+\r
+ public class MySwitch : Switch\r
+ {\r
+ public MySwitch () : base() {}\r
+\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ _flagGetViewStyle = true;\r
+ return base.GetViewStyle();\r
+ }\r
+\r
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)\r
+ {\r
+ _flagOnThemeChangedEvent = true;\r
+ }\r
+ }\r
+\r
+ public class DefaultSwitchStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new SwitchStyle();\r
+ }\r
}\r
}\r
}\r
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.SwitchStyle Tests")]
+ public class SwitchStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("SwitchStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SwitchStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.SwitchStyle.SwitchStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void SwitchStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new SwitchStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<SwitchStyle>(style, "Should be an instance of SwitchStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SwitchStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.SwitchStyle.SwitchStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "SwitchStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void SwitchStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new SwitchStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<SwitchStyle>(style1, "Should be an instance of SwitchStyle!");
+
+ var style2 = new SwitchStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<SwitchStyle>(style2, "Should be an instance of SwitchStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Thumb. Check whether Thumb is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SwitchStyle.Thumb A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Thumb_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SwitchStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SwitchStyle>(style, "Should be equal!");
+ style.Thumb = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Thumb.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Track. Check whether Track is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.SwitchStyle.Track A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Track_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new SwitchStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<SwitchStyle>(style, "Should be equal!");
+ style.Track = new ImageViewStyle() {ResourceUrl = "test.png"};
+ Assert.AreEqual("test.png", style.Track.ResourceUrl.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.SwitchStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new SwitchStyle();
+ var style2 = new SwitchStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
{
private const string TAG = "Components";
private bool _checkValue;
+ private static bool _flagGetViewStyle = true;
+ private static bool _flagOnThemeChangedEvent = true;
[SetUp]
public void Init()
[Test]
[Category("P1")]
+ [Description("Test Tab constructor using string. Check whether Tab is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Tab_INIT_WITH_STRING()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultTab", "default", typeof(DefaultTabStyle));
+ var tab = new Tab("defaultTab");
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Tab constructor using style. Check whether Tab is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "TabStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Tab_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be an instance of TabStyle!");
+
+ var tab = new Tab(style);
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Style. Check whether Style is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.Style A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]
+ public void Style_CHECK_GET_VALUE()
+ {
+ /* TEST CODE */
+ var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab!");
+
+ var style = tab.Style;\r
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be an instance of TabStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Test SelectedItemIndex. Check whether SelectedItemIndex works or not.")]
[Property("SPEC", "Tizen.NUI.Components.Tab.SelectedItemIndex A")]
[Property("SPEC_URL", "-")]
Assert.Fail("Caught Exception" + e.ToString());
}
}
- }
- public class MyTab : Tab
- {
- public bool flagGetAttributes = false;
- public bool flagOnUpdate = false;
- public bool flagOnThemeChangedEvent = false;
- public bool flagLayoutChild = false;
-
- public MyTab() : base()
- { }
-
- public MyTab(string style) : base(style)
- { }
-
- protected override ViewStyle GetViewStyle()
+ [Test]
+ [Category("P1")]
+ [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.ApplyStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ApplyStyle_NO_RETURN_VALUE()
{
- flagGetAttributes = true;
- return new TabStyle();
+ try
+ {
+ var tab = new Tab();
+ var style = new TabStyle();
+ tab.ApplyStyle(style);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
}
- protected override void OnUpdate()
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
{
- base.OnUpdate();
- flagOnUpdate = true;
+ try
+ {
+ _flagGetViewStyle = false;
+ var tab = new MyTab();
+ var style = tab.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
}
- protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+ [Test]
+ [Category("P1")]
+ [Description("Test OnThemeChangedEvent. Check whether OnThemeChangedEvent works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.OnThemeChangedEvent M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void OnThemeChangedEvent_CHECK_RETURN_VALUE()
{
- flagOnThemeChangedEvent = true;
+ try
+ {
+ _flagOnThemeChangedEvent = false;
+ StyleManager.Instance.Theme = "Family";
+ var tab = new Tab();
+ StyleManager.Instance.Theme = "Food";
+ Assert.IsNotNull(tab, "Should be not null");
+ Assert.IsTrue(_flagOnThemeChangedEvent, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
}
- protected override void LayoutChild()
- {
- base.LayoutChild();
- flagLayoutChild = true;
+ public class MyTab : Tab\r
+ {\r
+ public bool flagOnUpdate = false;\r
+ public bool flagLayoutChild = false;\r
+\r
+ public MyTab() : base()\r
+ { }\r
+\r
+ public MyTab(string style) : base(style)\r
+ { }\r
+\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ _flagGetViewStyle = true;\r
+ return new TabStyle();\r
+ }\r
+\r
+ protected override void OnUpdate()\r
+ {\r
+ base.OnUpdate();\r
+ flagOnUpdate = true;\r
+ }\r
+\r
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)\r
+ {\r
+ _flagOnThemeChangedEvent = true;\r
+ }\r
+\r
+ protected override void LayoutChild()\r
+ {\r
+ base.LayoutChild();\r
+ flagLayoutChild = true;\r
+ }\r
}
- }
+ public class DefaultTabStyle : StyleBase\r
+ {\r
+ protected override ViewStyle GetViewStyle()\r
+ {\r
+ return new TabStyle();\r
+ }\r
+ }
+ }\r
+\r
internal class UtilityTabStyle : StyleBase
{
- protected override ViewStyle GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
TabStyle attributes = new TabStyle
{
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.TabStyle Tests")]
+ public class TabStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("TabStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TabStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.TabStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TabStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be an instance of TabStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TabStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.TabStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "TabStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TabStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new TabStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<TabStyle>(style1, "Should be an instance of TabStyle!");
+
+ var style2 = new TabStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<TabStyle>(style2, "Should be an instance of TabStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test UnderLine. Check whether UnderLine is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.UnderLine A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void UnderLine_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be equal!");
+ style.UnderLine = new ViewStyle() {BackgroundImage = "test.png"};
+ Assert.AreEqual("test.png", style.UnderLine.BackgroundImage.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Text. Check whether Text is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.Text A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Text_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be equal!");
+ style.Text = new TextLabelStyle() {Text = "test"};
+ Assert.AreEqual("test", style.Text.Text.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test UseTextNaturalSize. Check whether UseTextNaturalSize is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.UseTextNaturalSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void UseTextNaturalSize_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be equal!");
+ style.UseTextNaturalSize = true;
+ Assert.AreEqual(true, style.UseTextNaturalSize, "Should be equals to the set value");
+ style.UseTextNaturalSize = false;
+ Assert.AreEqual(false, style.UseTextNaturalSize, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ItemSpace. Check whether ItemSpace is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.ItemSpace A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ItemSpace_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be equal!");
+ style.ItemSpace = 20;
+ Assert.AreEqual(20, style.ItemSpace, "Should be equals to the set value");
+ style.ItemSpace = 30;
+ Assert.AreEqual(30, style.ItemSpace, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ItemPadding. Check whether ItemPadding is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.ItemPadding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ItemPadding_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new TabStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<TabStyle>(style, "Should be equal!");
+ style.ItemPadding = new Extents(1,2,3,4);
+ Assert.AreEqual(1, style.ItemPadding.Start, "Should be equals to the set value");
+ Assert.AreEqual(2, style.ItemPadding.End, "Should be equals to the set value");
+ Assert.AreEqual(3, style.ItemPadding.Top, "Should be equals to the set value");
+ Assert.AreEqual(4, style.ItemPadding.Bottom, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.TabStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new TabStyle();
+ var style2 = new TabStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
public class ToastTests
{
private const string TAG = "Components";
+ private static bool _flagGetViewStyle = false;
[SetUp]
public void Init()
[Test]
[Category("P1")]
+ [Description("Test Toast constructor using string. Check whether Toast is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Toast_INIT_WITH_STRING()
+ {
+ /* TEST CODE */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultToast", "default", typeof(DefaultToastStyle));
+ var toast1 = new Toast("defaultToast");
+ Assert.IsNotNull(toast1, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(toast1, "Should be an instance of Toast!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Toast constructor using style. Check whether Toast is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ToastStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Toast_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style = new ToastStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ToastStyle>(style, "Should be an instance of ToastStyle!");
+
+ var toast = new Toast(style);
+ Assert.IsNotNull(toast, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Style. Check whether Style is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Toast.Style A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]
+ public void Style_CHECK_GET_VALUE()
+ {
+ /* TEST CODE */
+ var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null");
+ Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast!");
+
+ var style = toast.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ToastStyle>(style, "Should be an instance of ToastStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Test TextArray. Check whether TextArray works or not.")]
[Property("SPEC", "Tizen.NUI.Components.Toast.TextArray A")]
[Property("SPEC_URL", "-")]
Assert.Fail("Caught Exception" + e.ToString());
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Toast.ApplyStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ApplyStyle_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var button = new Toast();
+ var style = new ToastStyle();
+ button.ApplyStyle(style);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Toast.GetViewStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void GetViewStyle_CHECK_RETURN_VALUE()
+ {
+ try
+ {
+ _flagGetViewStyle = false;
+ var button = new MyToast();
+ var style = button.Style;
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsTrue(_flagGetViewStyle, "Should be true!");
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ public class MyToast : Toast
+ {
+ public MyToast () : base() {}
+
+ protected override ViewStyle GetViewStyle()
+ {
+ _flagGetViewStyle = true;
+ return base.GetViewStyle();
+ }
+ }
+
+ public class DefaultToastStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new ToastStyle();
+ }
+ }
}
}
\ No newline at end of file
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+using Tizen.NUI.BaseComponents;\r
+\r
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.ToastStyle Tests")]
+ public class ToastStyleTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("ToastStyleTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ToastStyle empty constructor. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ToastStyle.ToastStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ToastStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new ToastStyle();
+ Assert.IsNotNull(style, "Should be not null!");
+ Assert.IsInstanceOf<ToastStyle>(style, "Should be an instance of ToastStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ToastStyle constructor using style. Check it has been triggered")]
+ [Property("SPEC", "Tizen.NUI.Components.ToastStyle.ToastStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "ToastStyle")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ToastStyle_INIT_WITH_STYLE()
+ {
+ /* TEST CODE */
+ var style1 = new ToastStyle();
+ Assert.IsNotNull(style1, "Should be not null!");
+ Assert.IsInstanceOf<ToastStyle>(style1, "Should be an instance of ToastStyle!");
+
+ var style2 = new ToastStyle(style1);
+ Assert.IsNotNull(style2, "Should be not null!");
+ Assert.IsInstanceOf<ToastStyle>(style2, "Should be an instance of ToastStyle!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Text. Check whether Text is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ToastStyle.Text A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Text_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ToastStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ToastStyle>(style, "Should be an instance of ToastStyle!");
+ style.Text = new TextLabelStyle() {Text = "test"};
+ Assert.AreEqual("test", style.Text.Text.All, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Duration. Check whether Duration is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ToastStyle.Duration A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Duration_SET_GET_VALUE()
+ {
+ /* TEST CODE */
+ var style = new ToastStyle();
+ Assert.IsNotNull(style, "Should be not null");
+ Assert.IsInstanceOf<ToastStyle>(style, "Should be an instance of ToastStyle!");
+ style.Duration = 20;
+ Assert.AreEqual(20, style.Duration, "Should be equals to the set value");
+ style.Duration = 30;
+ Assert.AreEqual(30, style.Duration, "Should be equals to the set value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.ToastStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void CopyFrom_NO_RETURN_VALUE()
+ {
+ try
+ {
+ var style1 = new ToastStyle();
+ var style2 = new ToastStyle();
+ style2.CopyFrom(style1);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}