[TCSACR-411] Add Notification.MakeToast, Button.ItemAlignment and Button.ItemSpacing 37/257237/3
authorJiyun Yang <ji.yang@samsung.com>
Wed, 21 Apr 2021 11:09:34 +0000 (20:09 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Tue, 4 May 2021 05:47:58 +0000 (14:47 +0900)
Change-Id: I80fa50bedc253d5cec667aff2cf0ac49a1571fbe
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNotification.cs

index 747d32e..5898831 100755 (executable)
@@ -627,6 +627,71 @@ namespace Tizen.NUI.Components.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test ItemAlignment. Check whether ItemAlignment is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.ItemAlignment A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+        public void ItemAlignment_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            var button = new Components.Button();
+            Assert.IsNotNull(button, "Should be not null");
+            Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+            // Test Alignment.Begin
+            button.ItemAlignment = LinearLayout.Alignment.Begin;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.Begin, "Should be equal");
+
+            // Test Alignment.End
+            button.ItemAlignment = LinearLayout.Alignment.End;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.End, "Should be equal");
+
+            // Test Alignment.CenterHorizontal
+            button.ItemAlignment = LinearLayout.Alignment.CenterHorizontal;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.CenterHorizontal, "Should be equal");
+
+            // Test Alignment.Top
+            button.ItemAlignment = LinearLayout.Alignment.Top;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.Top, "Should be equal");
+
+            // Test Alignment.Bottom
+            button.ItemAlignment = LinearLayout.Alignment.Bottom;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.Bottom, "Should be equal");
+
+            // Test Alignment.CenterVertical
+            button.ItemAlignment = LinearLayout.Alignment.CenterVertical;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.CenterVertical, "Should be equal");
+
+            // Test Alignment.Center
+            button.ItemAlignment = LinearLayout.Alignment.Center;
+            Assert.AreEqual(button.ItemAlignment, LinearLayout.Alignment.Center, "Should be equal");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test ItemSpacing. Check whether ItemSpacing is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.ItemSpacing A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]
+        public void ItemSpacing_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            var button = new Components.Button();
+            Assert.IsNotNull(button, "Should be not null");
+            Assert.IsInstanceOf<Components.Button>(button, "Should be equal");
+
+            var value = new Size2D(10, 10);
+            button.ItemSpacing = value;
+
+            Assert.IsInstanceOf<Size2D>(button.ItemSpacing, "Should be equal");
+            Assert.AreEqual(button.ItemSpacing.Width, value.Width, "Should be equal");
+            Assert.AreEqual(button.ItemSpacing.Height, value.Height, "Should be equal");
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test OnKey. Check return the right value or not")]
         [Property("SPEC", "Tizen.NUI.Components.Button.OnKey M")]
         [Property("SPEC_URL", "-")]
index 5fbc66d..f53efab 100755 (executable)
@@ -176,6 +176,63 @@ namespace Tizen.NUI.Components.Tests
 \r
         [Test]\r
         [Category("P1")]\r
+        [Description("Test MakeToast. Check whether MakeToast works or not.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.Notification.MakeToast M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]\r
+        public void MakeToast_CHECK_RETURN_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var toast = Notification.MakeToast("Toast text", Notification.ToastBottom);\r
+            Assert.IsNotNull(toast, "Can't create success object Notification.");\r
+            Assert.IsInstanceOf<Notification>(toast, "Should be an instance of Notification type");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P2")]\r
+        [Description("Test SetLevel. Check illegal arguments.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.Notification.MakeToast M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MEX")]\r
+        [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]\r
+        public void MakeToast_ARGUMENT_NULL_EXCEPTION_WITH_TEXT()\r
+        {\r
+            /* TEST CODE */\r
+            try\r
+            {\r
+                var toast = Notification.MakeToast(null, Notification.ToastBottom);\r
+                Assert.Fail("Should throw an exception: Input text should not be null.");\r
+            }\r
+            catch (ArgumentNullException)\r
+            {\r
+                Assert.Pass("ArgumentNullException: passed!");\r
+            }\r
+        }\r
+\r
+        [Test]\r
+        [Category("P2")]\r
+        [Description("Test SetLevel. Check illegal arguments.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.Notification.MakeToast M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MEX")]\r
+        [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")]\r
+        public void MakeToast_ARGUMENT_NULL_EXCEPTION_WITH_GRAVITY()\r
+        {\r
+            /* TEST CODE */\r
+            try\r
+            {\r
+                var toast = Notification.MakeToast("Toast text", null);\r
+                Assert.Fail("Should throw an exception: Input gravity should not be null.");\r
+            }\r
+            catch (ArgumentNullException)\r
+            {\r
+                Assert.Pass("ArgumentNullException: passed!");\r
+            }\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
         [Description("Test Post. Check whether Post works or not.")]\r
         [Property("SPEC", "Tizen.NUI.Components.Notification.Post M")]\r
         [Property("SPEC_URL", "-")]\r