[Alarm][TCSACR-206][Add property setter for WeekFlag, Period, ScheduledDate] 05/198505/2
authorInkyun Kil <inkyun.kil@samsung.com>
Fri, 25 Jan 2019 04:30:24 +0000 (13:30 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 11 Feb 2019 02:26:24 +0000 (11:26 +0900)
Change-Id: I6efdc157287ebf3002c6cb85b893ad79f199fcbc
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
tct-suite-vs/Tizen.Alarm.Tests/testcase/TSAlarm.cs

index eefd1c7..016cd6c 100755 (executable)
@@ -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]