From: Jiyun Yang Date: Wed, 21 Apr 2021 11:09:34 +0000 (+0900) Subject: [TCSACR-411] Add Notification.MakeToast, Button.ItemAlignment and Button.ItemSpacing X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f248a36f5cf6c84d9204faa62eb743aefa00e861;p=test%2Ftct%2Fcsharp%2Fapi.git [TCSACR-411] Add Notification.MakeToast, Button.ItemAlignment and Button.ItemSpacing Change-Id: I80fa50bedc253d5cec667aff2cf0ac49a1571fbe Signed-off-by: Jiyun Yang --- diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs index 747d32e..5898831 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs @@ -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(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(button, "Should be equal"); + + var value = new Size2D(10, 10); + button.ItemSpacing = value; + + Assert.IsInstanceOf(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", "-")] diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNotification.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNotification.cs index 5fbc66d..f53efab 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNotification.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNotification.cs @@ -176,6 +176,63 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] + [Description("Test MakeToast. Check whether MakeToast works or not.")] + [Property("SPEC", "Tizen.NUI.Components.Notification.MakeToast M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")] + public void MakeToast_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + var toast = Notification.MakeToast("Toast text", Notification.ToastBottom); + Assert.IsNotNull(toast, "Can't create success object Notification."); + Assert.IsInstanceOf(toast, "Should be an instance of Notification type"); + } + + [Test] + [Category("P2")] + [Description("Test SetLevel. Check illegal arguments.")] + [Property("SPEC", "Tizen.NUI.Components.Notification.MakeToast M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")] + public void MakeToast_ARGUMENT_NULL_EXCEPTION_WITH_TEXT() + { + /* TEST CODE */ + try + { + var toast = Notification.MakeToast(null, Notification.ToastBottom); + Assert.Fail("Should throw an exception: Input text should not be null."); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P2")] + [Description("Test SetLevel. Check illegal arguments.")] + [Property("SPEC", "Tizen.NUI.Components.Notification.MakeToast M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Jiyun Yang, ji.yang@samsung.com")] + public void MakeToast_ARGUMENT_NULL_EXCEPTION_WITH_GRAVITY() + { + /* TEST CODE */ + try + { + var toast = Notification.MakeToast("Toast text", null); + Assert.Fail("Should throw an exception: Input gravity should not be null."); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] [Description("Test Post. Check whether Post works or not.")] [Property("SPEC", "Tizen.NUI.Components.Notification.Post M")] [Property("SPEC_URL", "-")]