From: pr.jung Date: Mon, 20 Aug 2018 04:59:00 +0000 (+0900) Subject: [Device][ACR-168][Add testcases for new apis] X-Git-Tag: tct5.0_m2~102^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F187106%2F5;p=test%2Ftct%2Fcsharp%2Fapi.git [Device][ACR-168][Add testcases for new apis] Change-Id: I6b4d6054583e3e68c2a6447b6c748968e4b12691 Signed-off-by: pr.jung --- diff --git a/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs b/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs old mode 100755 new mode 100644 index 878b503..c7aae90 --- a/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs +++ b/tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs @@ -97,14 +97,15 @@ namespace Tizen.System.Tests [Description("Test if get for Device.Display:State property is working properly")] [Property("SPEC", "Tizen.System.Display.State A")] [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] + [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] - public static void State_PROPERTY_READ_ONLY() + public static void State_PROPERTY_READ_WRITE() { if (isSupport == 1) { + Display.State = DisplayState.Normal; LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "State_READ Value:" + Display.State); - Assert.IsInstanceOf(Display.State, "Dsiaply state should be valid"); + Assert.IsTrue(Display.State == DisplayState.Normal, "Set/Get State value should be the same"); } else { diff --git a/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs b/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs old mode 100755 new mode 100644 index f869991..69c5f22 --- a/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs +++ b/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs @@ -58,5 +58,91 @@ namespace Tizen.System.Tests } } + [Test] + [Category("P1")] + [Description("Test if get for Tizen.System.Power:RequestLock method is working properly")] + [Property("SPEC", "Tizen.System.Power.RequestLock M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Pureum Jung, pr.jung@samsung.com")] + public static void RequestLock_CHECK_RESULT() + { + /* TEST CODE */ + try + { + foreach (PowerLock type in Enum.GetValues(typeof(PowerLock))) + { + Power.RequestLock(type, 2000); + } + } + catch (Exception e) + { + Assert.IsTrue(false, "failed to request cpu lock. " + e.Message); + } + } + + [Test] + [Category("P2")] + [Description("Check ArgumentException for RequestLock with non-existing lock type")] + [Property("SPEC", "Tizen.System.Power.RequestLock M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Pureum Jung, pr.jung@samsung.com")] + public static void RequestLock_ARGUMENT_EXCEPTION() + { + /* TEST CODE */ + try + { + Power.RequestLock((PowerLock)100, 2000); + } + catch (Exception e) + { + Assert.IsInstanceOf(e, "ArgumentException should be thrown for invalid lock type" + e.GetType()); + } + } + + [Test] + [Category("P1")] + [Description("Test if get for Tizen.System.Power:ReleaseLock method is working properly")] + [Property("SPEC", "Tizen.System.Power.ReleaseLock M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Pureum Jung, pr.jung@samsung.com")] + public static void ReleaseLock_CHECK_RESULT() + { + /* TEST CODE */ + try + { + foreach (PowerLock type in Enum.GetValues(typeof(PowerLock))) + { + Power.ReleaseLock(type); + } + } + catch (Exception e) + { + Assert.IsTrue(false, "failed to release cpu lock. " + e.Message); + } + } + + [Test] + [Category("P2")] + [Description("Check ArgumentException for ReleaseLock with non-existing lock type")] + [Property("SPEC", "Tizen.System.Power.ReleaseLock M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Pureum Jung, pr.jung@samsung.com")] + public static void ReleaseLock_ARGUMENT_EXCEPTION() + { + /* TEST CODE */ + try + { + Power.ReleaseLock((PowerLock)100); + } + catch (Exception e) + { + Assert.IsInstanceOf(e, "ArgumentException should be thrown for invalid lock type" + e.GetType()); + } + } + } }