[Applications][Non-ACR][Add negative test cases] 06/241906/2
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 20 Aug 2020 23:32:14 +0000 (08:32 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 21 Aug 2020 03:50:32 +0000 (12:50 +0900)
Adds:
 - SendLaunchRequest_CHECK_APP_NOT_FOUND_EXCEPTION()
 - SendLaunchRequest_CHECK_ARGUMENT_NULL_EXCEPTION()

Change-Id: I4c80053217bb024f912d160017533a17309900fb
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs

index cd705ee..ebe3125 100755 (executable)
@@ -3,7 +3,8 @@ using NUnit.Framework.TUnit;
 using System.Collections.Generic;
 using System.Threading.Tasks;
 using System;
-
+using Tizen.Applications.Exceptions;\r
+\r
 namespace Tizen.Applications.Tests
 {
 
@@ -17,6 +18,7 @@ namespace Tizen.Applications.Tests
         private const string MyAppId = "org.tizen.SampleServiceApp.Tizen";
         private const string MyAppId1 = "org.tizen.SampleServiceApp2.Tizen";
         private const string MyUIAppId = "org.tizen.example.UIApp.Tizen";
+        private const string _unknownAppId = "org.example.unknown.test.app";
         private bool _flag;
         private bool _replyFlag = false;
 
@@ -456,5 +458,57 @@ namespace Tizen.Applications.Tests
             await Task.Delay(5000);
             Assert.IsTrue (_replyFlag, " The flag should be true");
         }
+
+        [Test]
+        [Category("P2")]
+        [Description("Test : Send Launch Request - AppNotFoundException should be occurred")]
+        [Property("SPEC", "Tizen.Applications.AppControl.SendLaunchRequest M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")]
+        [Property("COVPARAM", "Tizen.Applications.AppControl")]
+        public void SendLaunchRequest_CHECK_APP_NOT_FOUND_EXCEPTION()
+        {\r
+\r
+            /* PRECONDITION
+             * Privilege: http://tizen.org/privilege/appmanager.launch
+             * */\r
+\r
+            /* TEST CODE */\r
+            var appControl = new AppControl();
+            appControl.Operation = AppControlOperations.Default;
+            appControl.ApplicationId = _unknownAppId;
+
+            try\r
+            {\r
+                AppControl.SendLaunchRequest(appControl);\r
+                Assert.Fail("AppNotFoundException should be occurred");\r
+            }
+            catch (AppNotFoundException)
+            {\r
+                Assert.Pass("AppNotFoundException occurs");\r
+            }
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Test : Send Launch Request - ArgumentNullException should be occurred")]
+        [Property("SPEC", "Tizen.Applications.AppControl.SendLaunchRequest M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("AUTHOR", "Hwankyu Jhun, h.jhun@samsung.com")]
+        [Property("COVPARAM", "Tizen.Applications.AppControl")]
+        public void SendLaunchRequest_CHECK_ARGUNMENT_NULL_EXCEPTION()
+        {
+            try\r
+            {\r
+                AppControl.SendLaunchRequest(null);\r
+                Assert.Fail("ArgumentNullException should be occurred");\r
+            }
+            catch (ArgumentNullException)
+            {\r
+                Assert.Pass("ArgumentNullException occurs");\r
+            }
+        }
     }
 }