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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.Button.ClickEventArgs Tests")]\r
- public class ButtonClickEventArgsTests\r
- {\r
- private const string TAG = "Components";\r
-\r
- [SetUp]\r
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.Button.ClickEventArgs Tests")]
+ public class ButtonClickEventArgsTests
+ {
+ private const string TAG = "Components";
+
+ [SetUp]
public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("ButtonClickEventArgsTests");
App.MainTitleChangeBackgroundColor(null);
- }\r
-\r
+ }
+
[TearDown]
public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
+ }
+
[Test]
[Category("P1")]
[Description("Test ClickEventArgs empty constructor. Check it has been triggered")]
/* TEST CODE */
var clickEventArgs = new Components.Button.ClickEventArgs();
Assert.IsNotNull(clickEventArgs, "Should be not null!");
- Assert.IsInstanceOf<Components.Button.ClickEventArgs>(clickEventArgs, "Should be equal!");\r
-\r
- }\r
- }\r
-}\r
+ Assert.IsInstanceOf<Components.Button.ClickEventArgs>(clickEventArgs, "Should be equal!");
+
+ }
+ }
+}
using NUnit.Framework.TUnit;\r
using System;\r
using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
using Tizen.NUI.Components;\r
using System.Runtime.InteropServices;\r
using System.Threading.Tasks;\r
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
Assert.IsInstanceOf<Button>(button, "Should be an instance of Button!");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a Button with nonexistent style.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.Button C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Button_INIT_WITH_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var button = new Button("defaultButtonX");
+ Assert.Fail("Should throw the Exception: There is no style of defaultButtonX !");
+ }
+ catch(InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Button constructor using style. Check it has been triggered")]
Assert.AreEqual(stringSelector.Selected, button.TextSelector.Selected, "Should be equals to the set value of TextSelector");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when TextSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.TextSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
+ public void TextSelector_SET_GET_VALUE_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+ button.TextSelector = null;
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch(NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test TranslatableTextSelector. Check whether TranslatableTextSelector is readable and writable.")]
Assert.AreEqual(stringSelector.Selected, button.TranslatableTextSelector.Selected, "Should be equals to the set value of TranslatableTextSelector");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when TranslatableTextSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.TranslatableTextSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
+ public void TranslatableTextSelector_SET_GET_VALUE_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+ button.TranslatableTextSelector = null;
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch (NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test TextColorSelector. Check whether TextColorSelector is readable and writable.")]
Assert.AreEqual(colorSelector.Selected.A, button.TextColorSelector.Selected.A, "Should be equals to the set value of TextColorSelector Selected A");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when TextColorSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.TextColorSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TextColorSelector_SET_GET_VALUE_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+ button.TextColorSelector = null;
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch(NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test PointSizeSelector. Check whether PointSizeSelector is readable and writable.")]
Assert.AreEqual(floatSelector.Selected, button.PointSizeSelector.Selected, "Should be equals to the set value of PointSizeSelector Selected");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when PointSizeSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.PointSizeSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void PointSizeSelector_SET_GET_VALUE_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+ button.PointSizeSelector = null;
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch(NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test IconURLSelector. Check whether IconURLSelector is readable and writable.")]
Assert.AreEqual(stringSelector.Selected, button.IconURLSelector.Selected, "Should be equals to the set value of IconURLSelector Selected");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when IconURLSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.IconURLSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
+ public void IconURLSelector_SET_GET_VALUE_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+ button.IconURLSelector = null;
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch(NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test IsSelected. Check whether IsSelected is readable and writable.")]
}
}
- public class DefaultButtonStyle : StyleBase\r
- {\r
- protected override ViewStyle GetViewStyle()\r
- {\r
- return new ButtonStyle();\r
- }\r
+ public class DefaultButtonStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new ButtonStyle();
+ }
}
}
}
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading!");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a Loading with nonexistent style")]
+ [Property("SPEC", "Tizen.NUI.Components.Loading.Loading C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Loading_INIT_WITH_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var loading = new Loading("defaultLoadingX");
+ Assert.Fail("Should throw the Exception: There is no style of defaultLoadingX !");
+ }
+ catch(InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Loading constructor using style. Check whether Loading is successfully created or not.")]
Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading!");
var style = loading.Style;
- Assert.IsNotNull(style, "Should be not null");\r
+ Assert.IsNotNull(style, "Should be not null");
Assert.IsInstanceOf<LoadingStyle>(style, "Should be an instance of LoadingStyle!");
}
}
}
- public class DefaultLoadingStyle : StyleBase\r
- {\r
- protected override ViewStyle GetViewStyle()\r
- {\r
- return new LoadingStyle();\r
- }\r
+ public class DefaultLoadingStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new LoadingStyle();
+ }
}
}
}
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.TUnit;\r
using System;\r
using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
using Tizen.NUI.Components;\r
using System.Runtime.InteropServices;\r
using System.Threading.Tasks;\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
Assert.IsInstanceOf<Popup>(popup, "Should be an instance of Popup!");\r
}\r
\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check exception when constructing a Popup with nonexistent style")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTX")]\r
+ [Property("COVPARAM", "string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Popup_INIT_WITH_STRING_Exception()\r
+ {\r
+ /* TEST CODE */\r
+ try\r
+ {\r
+ var popup = new Popup("defaultPopupX");\r
+ Assert.Fail("Should throw the Exception: There is no style of defaultPopupX !");\r
+ }\r
+ catch(InvalidOperationException e)\r
+ {\r
+ Assert.Pass("InvalidOperationException: passed!");\r
+ }\r
+ }\r
+\r
[Test]\r
[Category("P1")]\r
[Description("Test Popup constructor using style. Check whether Popup is successfully created or not.")]\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
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
using System.Threading;
using System.Threading.Tasks;
using Tizen.NUI.Components.Test;
-using Tizen.NUI.BaseComponents;\r
-\r
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
Assert.IsInstanceOf<Progress>(progress, "Should be an instance of Progress!");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a Progress with nonexistent style.")]
+ [Property("SPEC", "Tizen.NUI.Components.Progress.Progress C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Progress_INIT_WITH_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var progress = new Progress("defaultProgressX");
+ Assert.Fail("Should throw the Exception: There is no style of defaultProgressX !");
+ }
+ catch(InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Progress constructor using style. Check whether Progress is successfully created or not.")]
Assert.IsNotNull(progress, "Should be not null");
Assert.IsInstanceOf<Progress>(progress, "Should be an instance of Progress!");
- var style = progress.Style;\r
+ var style = progress.Style;
Assert.IsNotNull(style, "Should be not null");
Assert.IsInstanceOf<ProgressStyle>(style, "Should be an instance of ProgressStyle!");
}
}
}
- public class DefaultProgressStyle : StyleBase\r
- {\r
- protected override ViewStyle GetViewStyle()\r
- {\r
- return new ProgressStyle();\r
- }\r
+ public class DefaultProgressStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new ProgressStyle();
+ }
}
}
}
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar!");\r
}\r
\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check exception when constructing a ScrollBar with nonexistent style.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTX")]\r
+ [Property("COVPARAM", "string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ScrollBar_INIT_WITH_STRING_Exception()\r
+ {\r
+ /* TEST CODE */\r
+ try\r
+ {\r
+ var scrollBar = new ScrollBar("defaultScrollBarX");\r
+ Assert.Fail("Should throw the Exception: There is no style of defaultScrollBarX !");\r
+ }\r
+ catch(InvalidOperationException e)\r
+ {\r
+ Assert.Pass("InvalidOperationException: passed!");\r
+ }\r
+ }\r
+\r
[Test]\r
[Category("P1")]\r
[Description("Test ScrollBar constructor using style. Check whether ScrollBar is successfully created or not.")]\r
Assert.AreEqual(50, scrollBar.CurrentValue, "Should be equals to the set value of CurrentValue.");\r
}\r
\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check exception when current value less than min value.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.SetCurrentValue M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void SetCurrentValue_TEST_Exception_LESS()\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.MinValue = 0;\r
+ scrollBar.MaxValue = 100;\r
+ scrollBar.SetCurrentValue(-1);\r
+ Assert.Fail("Should throw the ArgumentOutOfRangeException!");\r
+ }\r
+ catch(ArgumentOutOfRangeException e)\r
+ {\r
+ Assert.Pass("ArgumentOutOfRangeException: passed!");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check exception when current value large than max value..")]\r
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.SetCurrentValue M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void SetCurrentValue_TEST_Exception_LARGE()\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.MinValue = 0;\r
+ scrollBar.MaxValue = 100;\r
+ scrollBar.SetCurrentValue(105);\r
+ Assert.Fail("Should throw the ArgumentOutOfRangeException!");\r
+ }\r
+ catch(ArgumentOutOfRangeException e)\r
+ {\r
+ Assert.Pass("ArgumentOutOfRangeException: passed!");\r
+ }\r
+ }\r
+\r
[Test]\r
[Category("P1")]\r
[Description("Test Dispose, try to dispose the ScrollBar.")]\r
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
using NUnit.Framework.TUnit;
using System;
using System.Threading.Tasks;
-using Tizen.NUI.BaseComponents;\r
+using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components.Test;
namespace Tizen.NUI.Components.Tests
Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider!");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a Button with nonexistent style.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.Slider C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Slider_INIT_WITH_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var slider = new Slider("defaultSliderX");
+ Assert.Fail("Should throw the Exception: There is no style of defaultSliderX !");
+ }
+ catch(InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Slider constructor using style. Check whether Slider is successfully created or not.")]
Assert.IsNotNull(slider, "Should be not null");
Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider!");
- var style = slider.Style;\r
+ var style = slider.Style;
Assert.IsNotNull(style, "Should be not null");
Assert.IsInstanceOf<SliderStyle>(style, "Should be an instance of SliderStyle!");
}
Assert.AreEqual("background", slider.ThumbImageURLSelector.All, "Retrieved ThumbImageURLSelector should be equal to set value.");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when ThumbImageURLSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.ThumbImageURLSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void ThumbImageURLSelector_SET_Exception()
+ {
+ try
+ {
+ var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
+ slider.ThumbImageURLSelector = null;
+
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch(NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test BgTrackColor. Check whether BgTrackColor works or not.")]
}
}
- public class DefaultSliderStyle : StyleBase\r
- {\r
- protected override ViewStyle GetViewStyle()\r
- {\r
- return new SliderStyle();\r
- }\r
+ public class DefaultSliderStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new SliderStyle();
+ }
}
}
}
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
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
+ public class MySliderStyle : StyleBase
+ {
+ public object _Content
+ {
+ get
+ {
+ return base.Content;
+ }
+ set
+ {
+ base.Content = value;
+ }
+ }
+ protected override ViewStyle GetViewStyle()
+ {
+ flagGetViewStyle = true;
+ return new SliderStyle();
+ }
}
}
}
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
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
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
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.Theme = "MyFamily";
+ StyleManager.Instance.ThemeChangedEvent += OnThemeChangedEvent;
+ StyleManager.Instance.Theme = "MyFood";
+ Assert.IsTrue(flagOnThemeChangedEvent, "Item change event should received");
StyleManager.Instance.ThemeChangedEvent -= OnThemeChangedEvent;
}
catch (Exception e)
}
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterStyle receive a null style.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterStyle_NULL_Style_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterStyle(null, "default", typeof(MyButtonStyle));
+ Assert.Fail("Should throw the InvalidOperationException!");
+ }
+ catch (InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterStyle receive a null theme.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterStyle_NULL_Theme_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterStyle("NButtonStyle", null, typeof(MyButtonStyle));
+ StyleManager.Instance.RegisterStyle("NButtonStyle", null, typeof(ButtonStyle));
+ Assert.Fail("Should throw the InvalidOperationException!");
+ }
+ catch (InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterStyle receive a null style type.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterStyle_NULL_STYLE_TYPE_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterStyle("NonButtonStyle", "default", null);
+ Assert.Fail("Should throw the ArgumentException!");
+ }
+ catch (ArgumentException e)
+ {
+ Assert.Pass("ArgumentException: passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterStyle receive same style in same theme.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterStyle_STYLE_Repeat_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterStyle("NonButtonStyle", "default", typeof(MyButtonStyle));
+ StyleManager.Instance.RegisterStyle("NonButtonStyle", "default", typeof(MyButtonStyle));
+ Assert.Fail("Should throw the InvalidOperationException!");
+ }
+ catch (InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test GetViewStyle. Check whether GetViewStyle works or not.")]
{
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
+ var style = StyleManager.Instance.GetViewStyle("FamilyButton");
+ Assert.IsNotNull(style, "Should be not null");
Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
}
catch (Exception e)
}
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterComponentStyle receive a null style.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterComponentStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterComponentStyle_NULL_Style_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterComponentStyle(null, typeof(Button) ,typeof(MyButtonStyle));
+ Assert.Fail("Should throw the ArgumentException!");
+ }
+ catch (ArgumentException e)
+ {
+ Assert.Pass("ArgumentException: passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterComponentStyle receive a null component type.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterComponentStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterComponentStyle_NULL_TYPE_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterComponentStyle("MyButtonStyle", null ,typeof(MyButtonStyle));
+ Assert.Fail("Should throw the ArgumentException!");
+ }
+ catch (ArgumentException e)
+ {
+ Assert.Pass("ArgumentException: passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when RegisterComponentStyle receive a null style type.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterComponentStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void RegisterComponentStyle_NULL_STYLE_TYPE_Exception()
+ {
+ try
+ {
+ StyleManager.Instance.RegisterComponentStyle("MyButtonStyle", typeof(Button) , null);
+ Assert.Fail("Should throw the ArgumentException!");
+ }
+ catch(ArgumentException e)
+ {
+ Assert.Pass("ArgumentException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test GetComponentStyle. Check whether GetComponentStyle works or not.")]
{
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
+ var style = StyleManager.Instance.GetComponentStyle(typeof(Button));
+ Assert.IsNotNull(style, "Should be not null");
Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");
}
catch (Exception e)
}
}
- public class MyButtonStyle : StyleBase\r
- {\r
- protected override ViewStyle GetViewStyle()\r
- {\r
- return new ButtonStyle();\r
- }\r
+ public class MyButtonStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new ButtonStyle();
+ }
}
}
}
using NUnit.Framework.TUnit;\r
using System;\r
using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
using Tizen.NUI.Components;\r
using System.Runtime.InteropServices;\r
using System.Threading.Tasks;\r
Assert.IsInstanceOf<Switch>(switch1, "Should be an instance of Switch!");\r
}\r
\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check exception when constructing a Switch with nonexistent style.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTX")]\r
+ [Property("COVPARAM", "string")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void Switch_INIT_WITH_STRING_Exception()\r
+ {\r
+ /* TEST CODE */\r
+ try\r
+ {\r
+ var switch1 = new Switch("defaultSwitchX");\r
+ Assert.Fail("Should throw the Exception: There is no style of defaultSwitchX !");\r
+ }\r
+ catch(InvalidOperationException e)\r
+ {\r
+ Assert.Pass("InvalidOperationException: passed!");\r
+ }\r
+ }\r
+\r
[Test]\r
[Category("P1")]\r
[Description("Test Switch constructor using style. Check whether Switch is successfully created or not.")]\r
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
using NUnit.Framework;
-using Tizen.NUI.UIComponents;
using Tizen.NUI.Components.Test;
namespace Tizen.NUI.Components.Tests
Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab!");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a Tab with nonexistent style.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Tab_INIT_WITH_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var tab = new Tab("defaultTabX");
+ Assert.Fail("Should throw the Exception: There is no style of defaultTabX !");
+ }
+ catch(InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Tab constructor using style. Check whether Tab is successfully created or not.")]
Assert.IsNotNull(tab, "Should be not null");
Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab!");
- var style = tab.Style;\r
+ var style = tab.Style;
Assert.IsNotNull(style, "Should be not null");
Assert.IsInstanceOf<TabStyle>(style, "Should be an instance of TabStyle!");
}
Assert.AreEqual(0, tab.SelectedItemIndex, "Retrieved SelectedItemIndex should be equal to set value");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when SelectedItemIndex receive an invalid value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.SelectedItemIndex A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void SelectedItemIndex_SET_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should return Tab instance.");
+
+ tab.SelectedItemIndex = -1;
+ Assert.Fail("Should throw the ArgumentException !");
+ }
+ catch(ArgumentException e)
+ {
+ Assert.Pass("ArgumentException: passed!");
+ }
+ }
[Test]
[Category("P1")]
Assert.AreEqual(color.A, tab.TextColorSelector.All.A, "Retrieved TextColorSelector should be equal to set value");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when TextColorSelector receive a null value.")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.TextColorSelector A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void TextColorSelector_SET_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
+ tab.TextColorSelector = null;
+ Assert.Fail("Should throw the NullReferenceException!");
+ }
+ catch(NullReferenceException e)
+ {
+ Assert.Pass("NullReferenceException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
- [Description("Test AddItem. Check whether table view add child")]
+ [Description("Test AddItem. Check whether tab add child")]
[Property("SPEC", "Tizen.NUI.Components.Tab.AddItem M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Test]
[Category("P1")]
- [Description("Test InsertItem. Check whether table view add child")]
+ [Description("Test InsertItem. Check whether tab add child")]
[Property("SPEC", "Tizen.NUI.Components.Tab.InsertItem M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
}
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when tab add child by an invalid index")]
+ [Property("SPEC", "Tizen.NUI.Components.Tab.InsertItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void InsertItem_INVALID_INDEX_Exception()
+ {
+ try
+ {
+ var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
+ tab.InsertItem(new Tab.TabItemData() { Text = "" }, -1);
+ Assert.Fail("Should throw the ArgumentException!");
+ }
+ catch (ArgumentException e)
+ {
+ Assert.Pass("ArgumentException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
- [Description("Test DeleteItem. Check whether table view add child")]
+ [Description("Test DeleteItem. Check whether tab add child")]
[Property("SPEC", "Tizen.NUI.Components.Tab.DeleteItem M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
}
}
- 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
+ public class MyTab : Tab
+ {
+ public bool flagOnUpdate = false;
+ public bool flagLayoutChild = false;
+
+ public MyTab() : base()
+ { }
+
+ public MyTab(string style) : base(style)
+ { }
+
+ protected override ViewStyle GetViewStyle()
+ {
+ _flagGetViewStyle = true;
+ return new TabStyle();
+ }
+
+ protected override void OnUpdate()
+ {
+ base.OnUpdate();
+ flagOnUpdate = true;
+ }
+
+ protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
+ {
+ _flagOnThemeChangedEvent = true;
+ }
+
+ protected override void LayoutChild()
+ {
+ base.LayoutChild();
+ flagLayoutChild = true;
+ }
+ }
+
+ public class DefaultTabStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new TabStyle();
+ }
+ }
+ }
+
internal class UtilityTabStyle : StyleBase
{
protected override ViewStyle GetViewStyle()
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]
Assert.IsInstanceOf<Toast>(toast1, "Should be an instance of Toast!");
}
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a Toast with nonexistent style.")]
+ [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+ public void Toast_INIT_WITH_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var toast1 = new Toast("defaultToastX");
+ Assert.Fail("Should throw the Exception: There is no style of defaultToastX !");
+ }
+ catch(InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test Toast constructor using style. Check whether Toast is successfully created or not.")]
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
+using Tizen.NUI.BaseComponents;
+
namespace Tizen.NUI.Components.Tests
{
[TestFixture]