From: Hwankyu Jhun Date: Thu, 20 Aug 2020 23:32:14 +0000 (+0900) Subject: [Applications][Non-ACR][Add negative test cases] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F241906%2F2;p=test%2Ftct%2Fcsharp%2Fapi.git [Applications][Non-ACR][Add negative test cases] Adds: - SendLaunchRequest_CHECK_APP_NOT_FOUND_EXCEPTION() - SendLaunchRequest_CHECK_ARGUMENT_NULL_EXCEPTION() Change-Id: I4c80053217bb024f912d160017533a17309900fb Signed-off-by: Hwankyu Jhun --- diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs index cd705ee..ebe3125 100755 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs +++ b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSAppControl.cs @@ -3,7 +3,8 @@ using NUnit.Framework.TUnit; using System.Collections.Generic; using System.Threading.Tasks; using System; - +using Tizen.Applications.Exceptions; + 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() + { + + /* PRECONDITION + * Privilege: http://tizen.org/privilege/appmanager.launch + * */ + + /* TEST CODE */ + var appControl = new AppControl(); + appControl.Operation = AppControlOperations.Default; + appControl.ApplicationId = _unknownAppId; + + try + { + AppControl.SendLaunchRequest(appControl); + Assert.Fail("AppNotFoundException should be occurred"); + } + catch (AppNotFoundException) + { + Assert.Pass("AppNotFoundException occurs"); + } + } + + [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 + { + AppControl.SendLaunchRequest(null); + Assert.Fail("ArgumentNullException should be occurred"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException occurs"); + } + } } }