From 1b2c8c0ccdb27734f3cdfa700210829a60c1cb3b Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 21 Aug 2020 08:32:14 +0900 Subject: [PATCH] [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 --- .../testcase/TSAppControl.cs | 56 +++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) 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"); + } + } } } -- 2.7.4