From: Inkyun Kil Date: Fri, 25 Jan 2019 04:30:24 +0000 (+0900) Subject: [Alarm][TCSACR-206][Add property setter for WeekFlag, Period, ScheduledDate] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=107f29acb97cb3527b6de03f9eb2cdeae9ac8376;p=test%2Ftct%2Fcsharp%2Fapi.git [Alarm][TCSACR-206][Add property setter for WeekFlag, Period, ScheduledDate] Change-Id: I6efdc157287ebf3002c6cb85b893ad79f199fcbc Signed-off-by: Inkyun Kil --- diff --git a/tct-suite-vs/Tizen.Alarm.Tests/testcase/TSAlarm.cs b/tct-suite-vs/Tizen.Alarm.Tests/testcase/TSAlarm.cs index eefd1c79b..016cd6c50 100755 --- a/tct-suite-vs/Tizen.Alarm.Tests/testcase/TSAlarm.cs +++ b/tct-suite-vs/Tizen.Alarm.Tests/testcase/TSAlarm.cs @@ -49,8 +49,8 @@ namespace Tizen.Applications.Tests [Property("SPEC", "Tizen.Applications.Alarm.WeekFlag A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRE")] - [Property("AUTHOR", "Jiwoong Im, jiwoong.im@samsung.com")] - public void WeekFlag_RETURN_ENUM() + [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")] + public void WeekFlag_SET_GET() { Tizen.Applications.AppControl appControl = new Tizen.Applications.AppControl(); var flag = AlarmWeekFlag.AllDays; @@ -60,6 +60,10 @@ namespace Tizen.Applications.Tests _alarm = AlarmManager.CreateAlarm(DateTime.Now.AddSeconds(10), AlarmWeekFlag.AllDays, appControl); Assert.IsNotNull(_alarm); Assert.AreEqual(flag, _alarm.WeekFlag, "Propety \"WeekFlag\": the set value and the get value should be equal"); + + var newFlag = AlarmWeekFlag.Monday; + _alarm.WeekFlag = newFlag; + Assert.AreNotEqual(flag, _alarm.WeekFlag, "Property \"WeekFlag\" : If the WeekFlag is updated, the flag should be not equal to previous flag"); } [Test] @@ -68,8 +72,9 @@ namespace Tizen.Applications.Tests [Property("SPEC", "Tizen.Applications.Alarm.ScheduledDate A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Jiwoong Im, jiwoong.im@samsung.com")] - public void ScheduledDate_READ_ONLY() + [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")] + + public void ScheduledDate_SET_GET() { Tizen.Applications.AppControl appControl = new Tizen.Applications.AppControl(); var now = DateTime.Now.AddSeconds(10); @@ -80,6 +85,10 @@ namespace Tizen.Applications.Tests _alarm = AlarmManager.CreateAlarm(date, AlarmWeekFlag.AllDays, appControl); Assert.IsNotNull(_alarm); Assert.AreEqual(date, _alarm.ScheduledDate, "Propety \"ScheduledDate\": the set value and the get value should be equal"); + + var newDate = new DateTime(now.Year + 10, now.Month, now.Day, now.Hour, now.Minute, now.Second); + _alarm.ScheduledDate = newDate; + Assert.AreNotEqual(date.Year, _alarm.ScheduledDate.Year, "Property \"ScheduledDate\" : If the scheduledDate is updated, the date should be not equal to previous date"); } [Test] @@ -88,8 +97,8 @@ namespace Tizen.Applications.Tests [Property("SPEC", "Tizen.Applications.Alarm.Period A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Jiwoong Im, jiwoong.im@samsung.com")] - public void Period_READ_ONLY() + [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")] + public void Period_SET_GET() { Tizen.Applications.AppControl appControl = new Tizen.Applications.AppControl(); int period = 10; @@ -99,6 +108,10 @@ namespace Tizen.Applications.Tests _alarm = AlarmManager.CreateAlarm(100, period, appControl); Assert.IsNotNull(_alarm); Assert.Greater(_alarm.Period, 600, "Propety \"Period\": The minimum value which is calculated by OS is 600sec"); + + int previousPeriod = _alarm.Period; + _alarm.Period = 6000; + Assert.AreNotEqual(previousPeriod, _alarm.Period, "Property \"Period\" : If the period is updated, the period should be not equal to previous period"); } [Test]