[NUI.Components][Non-ACR] Add negative testcases 88/229488/9
authorXianbing Teng <xb.teng@samsung.com>
Wed, 1 Apr 2020 09:19:05 +0000 (17:19 +0800)
committerXianbing Teng <xb.teng@samsung.com>
Tue, 7 Apr 2020 05:31:34 +0000 (13:31 +0800)
Change-Id: Icf248c56263958b6c2fa275206080a3c8e467e5e

25 files changed:
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.ClickEventArgs.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangedEventArgs.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoading.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoadingStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.ButtonClickEventArgs.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgress.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgressStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBar.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBarStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSliderStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleBase.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.SelectEventArgs.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitchStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.TabItemData.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabStyle.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastStyle.cs

index e480464b057041e3b0eb3d84b6322fd1b2c9906d..3b85575d55776b879236ec481e5dc4fd365f743d 100755 (executable)
@@ -2,35 +2,34 @@ 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;\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")]
@@ -43,8 +42,8 @@ namespace Tizen.NUI.Components.Tests
             /* 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!");
+
+        }
+    }
+}
index 69067ccc289a40146f5ea632b132fa4b95c2fcfe..586424fada79f1bed76c846ebac1ed31241f2a0e 100755 (executable)
@@ -2,7 +2,6 @@ using NUnit.Framework;
 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
index 973999ccc1745d5867978caa596570ecd409078e..69e48380cbf98374d1e4de68c0d53c0b3cb83e8d 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
@@ -77,6 +76,28 @@ namespace Tizen.NUI.Components.Tests
             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")]
@@ -295,6 +316,31 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -321,6 +367,31 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -354,6 +425,31 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -380,6 +476,31 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -406,6 +527,30 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -650,12 +795,12 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
-        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();
+            }
         }
     }
 }
index a735124399d3fa1c6e533b6f74a343154f5386d9..0a10a0079832cd88ac2866ac6aae7c47edce6322 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 450d43b2c71dd72a1a572793957cf07dcaa13372..5851f74c3e61fcbf57175c7d2d8f0fe257ab9018 100755 (executable)
@@ -64,6 +64,28 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -99,7 +121,7 @@ namespace Tizen.NUI.Components.Tests
             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!");
         }
 
@@ -225,12 +247,12 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
-        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();
+            }
         }
     }
 }
index 589db5765a267d21b9d4a25946d41a07a25075f6..125dfbb6063b4a854f9e3fbeed76a71aad365af3 100644 (file)
@@ -2,7 +2,6 @@ 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;
index cef062fa54c76dff74100576a9d30bda656b4692..2d5a8b5c091e118a2ac379cc1fdf2eadb4fae27b 100755 (executable)
@@ -2,7 +2,6 @@ using NUnit.Framework;
 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
index 799888c751e4f91e25622ae3860571c4a6d20ca8..827fead1dea34369e5a4696bd32d99fff6a1a39d 100755 (executable)
@@ -2,7 +2,6 @@ using NUnit.Framework;
 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
@@ -75,6 +74,28 @@ namespace Tizen.NUI.Components.Tests
             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
@@ -385,7 +406,6 @@ namespace Tizen.NUI.Components.Tests
                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());\r
                 Assert.Fail("Caught Exception" + e.ToString());\r
             }\r
-\r
         }\r
 \r
         [Test]\r
index faf065f065884ca517b8ac1f35c6f37140cceb14..294a0482289547d28d3ecbc0c08466492b500503 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 8d29186c880ca36bcf40b3ba23f11aae6b121b2b..5e6ef5bac8267d8029a2b35d2a1761074853d4e9 100755 (executable)
@@ -6,8 +6,8 @@ using Tizen.NUI.Components;
 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]
@@ -65,6 +65,28 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -99,7 +121,7 @@ namespace Tizen.NUI.Components.Tests
             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!");
         }
@@ -445,12 +467,12 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
-        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();
+            }
         }
     }
 }
index e22418fe4f5576decc2b50ca1faf663762e5840f..d3db72945c4d7500aa0e6b5aef080cb23e70e571 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 5f0358db64498ded5db7b56fe596dd65f141e867..09d903925a09a1e533cc42d25849046faa433bc4 100755 (executable)
@@ -67,6 +67,28 @@ namespace Tizen.NUI.Components.Tests
             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
@@ -297,6 +319,60 @@ namespace Tizen.NUI.Components.Tests
             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
index deb65cb1c8299a1bdb9014b3b954fcd7aad0da36..b86032c55664583fc52d8a7c301b38c3f23921d3 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 66bf553d32797ad76bf2a97f8acc493fdfa35263..f711082ffab8cecd44ec27be1c909881f55abe45 100755 (executable)
@@ -2,7 +2,7 @@ using NUnit.Framework;
 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
@@ -87,6 +87,28 @@ 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.")]
@@ -121,7 +143,7 @@ namespace Tizen.NUI.Components.Tests
             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!");
         }
@@ -270,6 +292,31 @@ namespace Tizen.NUI.Components.Tests
             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.")]
@@ -572,12 +619,12 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
-        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();
+            }
         }
     }
 }
index e42b908f6963cf42080723e9333837af956efddd..c015851e5ff19b8ec00c74aea679faf7e3cd4afc 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 6d2a04acb27eaaa33d1a9026d0bf749fd5f9b802..1b8fdf2335849a9146ce9d603466022dc4785ae9 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
@@ -65,24 +64,24 @@ namespace Tizen.NUI.Components.Tests
             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();
+            }
         }
     }
 }
index e671feb48d5c50a23f76350c532fccb0b95e9d10..ef3ef3198f042a6b5b2b023202e4516cae1511e6 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
@@ -30,20 +29,20 @@ namespace Tizen.NUI.Components.Tests
         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 */
@@ -51,10 +50,10 @@ namespace Tizen.NUI.Components.Tests
             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)
@@ -113,6 +112,88 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
+        [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.")]
@@ -126,8 +207,8 @@ namespace Tizen.NUI.Components.Tests
             {
                 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)
@@ -155,6 +236,66 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
+        [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.")]
@@ -168,8 +309,8 @@ namespace Tizen.NUI.Components.Tests
             {
                 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)
@@ -178,12 +319,12 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
-        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();
+            }
         }
     }
 }
index c9797e96a9d8b62d5b7799f4ab7174faa3e632b1..ec7ddb260eb2e3079738ff4191e467ff124548e7 100755 (executable)
@@ -2,7 +2,6 @@ using NUnit.Framework;
 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
index a2174afd9efd090699e251ae08d017343d23b081..f8acd0340bddb07cc8e015df39ee483b63c327f9 100755 (executable)
@@ -68,6 +68,28 @@ namespace Tizen.NUI.Components.Tests
             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
index 45c7e1b8492e2b21c906d9904101c8b0a09216ff..cc80bfde418f0ec8e0842b09d12e94bff565ef69 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 1335248569509cd25e2736f4f2ef95c81a2809ff..8470aff477cd68b230f14daa0c5aa80d01fbf06a 100755 (executable)
@@ -1,5 +1,4 @@
 using NUnit.Framework;
-using Tizen.NUI.UIComponents;
 using Tizen.NUI.Components.Test;
 
 namespace Tizen.NUI.Components.Tests
index 9e3895fa0a79f7f2f749c102bc145a5bcc177f17..dfcbf07af7d5b36709a2bce661c956721a2437e2 100755 (executable)
@@ -68,6 +68,28 @@ 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.")]
@@ -102,7 +124,7 @@ namespace Tizen.NUI.Components.Tests
             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!");
         }
@@ -125,6 +147,30 @@ namespace Tizen.NUI.Components.Tests
             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")]
@@ -314,9 +360,34 @@ namespace Tizen.NUI.Components.Tests
             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")]
@@ -345,7 +416,7 @@ namespace Tizen.NUI.Components.Tests
 
         [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")]
@@ -372,9 +443,33 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
+        [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")]
@@ -549,50 +644,50 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
-        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()
index 9129a729c2cf089006a4c6eb28b9038d3a384605..162b234146767e74e97135d0ed427fbd0730a4ea 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]
index 71ebbede59a7a548af784c6a843346c97faabaaf..dca8f783a0e0b5eacbb3e52dee0904fbd695dee2 100755 (executable)
@@ -61,6 +61,28 @@ namespace Tizen.NUI.Components.Tests
             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.")]
index 529d60313eee94acb308e2b31c9593eb0c939e7b..fee81af0e2aacdf49d7124000f34657eb0c5f0f7 100644 (file)
@@ -2,13 +2,12 @@ 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
+using Tizen.NUI.BaseComponents;
+
 namespace Tizen.NUI.Components.Tests
 {
     [TestFixture]