From 29573488c9133689848ac19ac568c736a5b40890 Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Mon, 20 Aug 2018 13:59:00 +0900 Subject: [PATCH] [Device][ACR-168][Add testcases for new apis] Change-Id: I6b4d6054583e3e68c2a6447b6c748968e4b12691 Signed-off-by: pr.jung --- .../Tizen.Device.Tests/testcase/TSDisplay.cs | 7 +- .../Tizen.Device.Tests/testcase/TSPower.cs | 86 ++++++++++++++++++++++ 2 files changed, 90 insertions(+), 3 deletions(-) mode change 100755 => 100644 tct-suite-vs/Tizen.Device.Tests/testcase/TSDisplay.cs mode change 100755 => 100644 tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs 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()); + } + } + } } -- 2.7.4