[NUI][TCSACR-349] Add and deprecate Button EventArgs classes 96/244896/3
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 25 Sep 2020 06:18:43 +0000 (15:18 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 14 Oct 2020 07:50:45 +0000 (16:50 +0900)
Add ClickedEventArgs class.
Deprecate Button.ClickEventArgs class.

Change-Id: Id621f3199b63dd7d03ee7531bcff970c3ebec52e

tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSClickedEventArgs.cs [new file with mode: 0755]

index bb81e24..5303881 100755 (executable)
@@ -179,6 +179,44 @@ namespace Tizen.NUI.Components.Tests
 \r
         [Test]
         [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when user click the button")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.Clicked E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
+        [Precondition(1, "If test on TV, prepare mouse and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Click(Touch) the button.")]
+        [Step(3, "TC will pass after touch or click.")]
+        [Postcondition(1, "NA")]
+        public async Task Clicked_CB()
+        {
+            _button = new Button(new ButtonStyle());
+            CreateMyButton(_button, "Click me!");\r
+            if (_isWearable)
+            {
+                _wearTestPage.ExecuteTC(_view);
+            }
+            else
+            {
+                _testPage.ExecuteTC(_view);
+            }
+            FocusManager.Instance.SetCurrentFocusView(_button);
+            _button.Clicked += OnClicked;
+            await ManualTest.WaitForConfirm();
+            _button.Clicked -= OnClicked;
+            if (_isWearable)
+            {
+                _wearTestPage.ClearTestCase(_view);
+            }
+            else
+            {
+                _testPage.ClearTestCase(_view);
+            }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
         [Description("Test: Click. Check whether the event will be triggered when setting focus to the button")]
         [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusGained M")]
         [Property("SPEC_URL", "-")]
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSClickedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSClickedEventArgs.cs
new file mode 100755 (executable)
index 0000000..b66f379
--- /dev/null
@@ -0,0 +1,46 @@
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+    [TestFixture]
+    [Description("Tizen.NUI.Components.ClickedEventArgs Tests")]
+    public class ClickedEventArgsTests
+    {
+        private const string TAG = "Components";
+
+        [SetUp]
+        public void Init()
+        {
+            Tizen.Log.Info(TAG, "Init() is called!");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            Tizen.Log.Info(TAG, "Destroy() is called!");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test ClickedEventArgs empty constructor. Check it has been triggered")]
+        [Property("SPEC", "Tizen.NUI.Components.ClickedEventArgs.ClickedEventArgs C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]
+        public void ClickedEventArgs_CHECK_VALUE()
+        {
+            /* TEST CODE */
+            var clickEventArgs = new Components.ClickedEventArgs();
+            Assert.IsNotNull(clickEventArgs, "Should be not null!");
+            Assert.IsInstanceOf<Components.ClickedEventArgs>(clickEventArgs, "Should be equal!");
+
+        }
+    }
+}