From: SukHyung, Kang Date: Wed, 1 Jul 2020 08:55:22 +0000 (+0900) Subject: [WidgetControl][TCSACR-325][Add TC for new property SetupAppId] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6061f72840bddeee3475e57a27c570d28eda3234;p=test%2Ftct%2Fcsharp%2Fapi.git [WidgetControl][TCSACR-325][Add TC for new property SetupAppId] Add new TC for new property SetupAppId - positive TC to get the property - negative TC for exception - TC test app is added that has SetupAppId attribute Change-Id: I6c9774f974c7124b515d9952c5d069d6a1928f17 Signed-off-by: SukHyung, Kang --- diff --git a/tct-suite-vs/Resource/Tizen.WidgetControl.Tests/org.tizen.WidgetCtrlSample2-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.WidgetControl.Tests/org.tizen.WidgetCtrlSample2-1.0.0.tpk new file mode 100755 index 000000000..1da405ba0 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.WidgetControl.Tests/org.tizen.WidgetCtrlSample2-1.0.0.tpk differ diff --git a/tct-suite-vs/Tizen.WidgetControl.Tests/testcase/TSWidgetControl.cs b/tct-suite-vs/Tizen.WidgetControl.Tests/testcase/TSWidgetControl.cs index 2cb131ab0..cd95b2e97 100755 --- a/tct-suite-vs/Tizen.WidgetControl.Tests/testcase/TSWidgetControl.cs +++ b/tct-suite-vs/Tizen.WidgetControl.Tests/testcase/TSWidgetControl.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using NUnit.Framework; using NUnit.Framework.TUnit; using System; +using Tizen.System; namespace Tizen.WidgetControl.Tests { @@ -11,11 +12,17 @@ namespace Tizen.WidgetControl.Tests public class WidgetControlTests { private static Tizen.Applications.WidgetControl _widgetControl; + private static Tizen.Applications.WidgetControl _widgetControl2; + private static Tizen.Applications.WidgetControl _widgetControl3; + private const string MyWidgetId = "org.tizen.WidgetCtrlSample"; private const string MyWidgetId1 = "org.tizen.WidgetCtrlSample1"; + private const string MyWidgetId2 = "org.tizen.WidgetCtrlSample2"; private const string Lang = "en_US"; private const string TAG = "WidgetControlTest"; + static bool isWidgetSupported = false; + private static void OnCreated(object sender, Tizen.Applications.WidgetLifecycleEventArgs args) { } @@ -36,6 +43,10 @@ namespace Tizen.WidgetControl.Tests public void Init() { _widgetControl = new Tizen.Applications.WidgetControl(MyWidgetId); + _widgetControl2 = new Tizen.Applications.WidgetControl(MyWidgetId2); + _widgetControl3 = new Tizen.Applications.WidgetControl(""); + + Information.TryGetValue("http://tizen.org/feature/shell.appwidget", out isWidgetSupported); LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST"); } @@ -43,6 +54,8 @@ namespace Tizen.WidgetControl.Tests public void Destroy() { _widgetControl = null; + _widgetControl2 = null; + _widgetControl3 = null; LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST"); } @@ -264,5 +277,55 @@ namespace Tizen.WidgetControl.Tests Assert.IsInstanceOf(_widgetControl.PackageId); Assert.AreEqual(_widgetControl.PackageId, "WidgetCtrlSample.Tizen"); } + + [Test] + [Category("P1")] + [Description("Test : Check whether SetupAppId value is valid")] + [Property("SPEC", "Tizen.Applications.WidgetControl.SetupAppId A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void SetupAppId_PROPERTY_GET() + { + try + { + Assert.IsInstanceOf(_widgetControl2.SetupAppId); + Assert.AreEqual(_widgetControl2.SetupAppId, "org.tizen.setupappid"); + } + catch (NotSupportedException) + { + Assert.IsTrue(isWidgetSupported == false, "Invalid NotSupportedException"); + } + catch (Exception e) + { + Assert.Fail("There should be no exception " + e.ToString()); + } + } + + [Test] + [Category("P2")] + [Description("Test : Check whether SetupAppId value is valid")] + [Property("SPEC", "Tizen.Applications.WidgetControl.SetupAppId A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Junghoon Park, jh9216.park@samsung.com")] + public void SetupAppId_INVALID_OPERATION_EXCEPTION() + { + try + { + Assert.Throws(delegate + { + string id = _widgetControl3.SetupAppId; + }); + } + catch (NotSupportedException) + { + Assert.IsTrue(isWidgetSupported == false, "Invalid NotSupportedException"); + } + catch (Exception e) + { + Assert.Fail("There should be no exception " + e.ToString()); + } + } } }