[NUI] Add TCs for Public Events
authorzhouleonlei <zhouleon.lei@samsung.com>
Fri, 28 May 2021 08:54:44 +0000 (16:54 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 1 Jun 2021 08:03:31 +0000 (17:03 +0900)
test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Events/TSGestureDetector.cs
test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Events/TSGestureDetectorManager.cs

index 08b5c85..1d8a576 100755 (executable)
@@ -44,7 +44,6 @@ namespace Tizen.NUI.Devel.Tests
             GestureDetector newOne = new GestureDetector(ret);
             Assert.IsNotNull(newOne, "should be not null");
             Assert.IsInstanceOf<GestureDetector>(newOne, "should be an instance of testing target class!");
-
            
             GestureDetector newTwo = new GestureDetector(GestureDetector.getCPtr(ret).Handle, true);
             Assert.IsNotNull(newTwo, "should be not null");
@@ -67,8 +66,8 @@ namespace Tizen.NUI.Devel.Tests
         public void GestureDetectorAttach()
         {
             tlog.Debug(tag, $"GestureDetectorAttach START");
-                       
-            GestureDetector ret = new GestureDetector();
+
+            LongPressGestureDetector ret = new LongPressGestureDetector();
             Assert.IsNotNull(ret, "should be not null");
             Assert.IsInstanceOf<GestureDetector>(ret, "should be an instance of testing target class!");
 
@@ -92,13 +91,14 @@ namespace Tizen.NUI.Devel.Tests
         public void GestureDetectorDetach()
         {
             tlog.Debug(tag, $"GestureDetectorDetach START");
-            GestureDetector ret = new GestureDetector();
+            LongPressGestureDetector ret = new LongPressGestureDetector();
+
             Assert.IsNotNull(ret, "should be not null");
             Assert.IsInstanceOf<GestureDetector>(ret, "should be an instance of testing target class!");
 
             View view = new View();
-            ret.Attach(view);
 
+            ret.Attach(view);
             ret.Detach(view);
             ret.Dispose();
             
@@ -116,7 +116,7 @@ namespace Tizen.NUI.Devel.Tests
         public void GestureDetectorDetachAll()
         {
             tlog.Debug(tag, $"GestureDetectorDetachAll START");
-            GestureDetector ret = new GestureDetector();
+            LongPressGestureDetector ret = new LongPressGestureDetector();
             Assert.IsNotNull(ret, "should be not null");
             Assert.IsInstanceOf<GestureDetector>(ret, "should be an instance of testing target class!");
 
@@ -140,7 +140,7 @@ namespace Tizen.NUI.Devel.Tests
         public void GestureDetectorGetAttachedViewCount()
         {
             tlog.Debug(tag, $"GestureDetectorGetAttachedViewCount START");
-            GestureDetector ret = new GestureDetector();
+            LongPressGestureDetector ret = new LongPressGestureDetector();
             Assert.IsNotNull(ret, "should be not null");
             Assert.IsInstanceOf<GestureDetector>(ret, "should be an instance of testing target class!");
 
@@ -166,7 +166,7 @@ namespace Tizen.NUI.Devel.Tests
         public void GestureDetectorGetAttachedView()
         {
             tlog.Debug(tag, $"GestureDetectorGetAttachedView START");
-            GestureDetector ret = new GestureDetector();
+            LongPressGestureDetector ret = new LongPressGestureDetector();
             Assert.IsNotNull(ret, "should be not null");
             Assert.IsInstanceOf<GestureDetector>(ret, "should be an instance of testing target class!");
 
@@ -196,11 +196,8 @@ namespace Tizen.NUI.Devel.Tests
             GestureDetector newOne = new GestureDetector();
             
             newOne = ret;
-            
             ret.Dispose();
             newOne.Dispose();
-            
-            
             tlog.Debug(tag, $"GestureDetectorAssign END (OK)");
             Assert.Pass("GestureDetectorAssign");
         }
index 0fc0e54..7694992 100755 (executable)
@@ -3,6 +3,7 @@ using NUnit.Framework.TUnit;
 using System;
 using Tizen.NUI;
 using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Events;
 
 namespace Tizen.NUI.Devel.Tests
 {
@@ -37,6 +38,12 @@ namespace Tizen.NUI.Devel.Tests
         {
             tlog.Debug(tag, $"GestureDetectorManagerConstructor START");
             View view = new View();
+
+            GestureDetectorManager a1 = new GestureDetectorManager(view, new GestureDetectorManager.GestureListener());
+            a1.Dispose();
+
+            GestureDetectorManager b1 = new GestureDetectorManager(null, new GestureDetectorManager.GestureListener());
+            GestureDetectorManager c1 = new GestureDetectorManager(view, null);
             view.Dispose();
 
             tlog.Debug(tag, $"GestureDetectorManagerConstructor END (OK)");
@@ -53,6 +60,14 @@ namespace Tizen.NUI.Devel.Tests
         public void GestrueFeedTouchEvent()
         {
             tlog.Debug(tag, $"GestrueFeedTouchEvent START");
+            object sender = new object();
+            View view = new View();
+            View.TouchEventArgs e = new View.TouchEventArgs();
+            GestureDetectorManager a1 = new GestureDetectorManager(view, new GestureDetectorManager.GestureListener());
+
+            a1.FeedTouchEvent(sender, e);
+
+            a1.Dispose();
             tlog.Debug(tag, $"GestrueFeedTouchEvent END (OK)");
             Assert.Pass("GestrueFeedTouchEvent");
         }