Esempio n. 1
0
        public void TestValidateTimeReturnsTrueForFutureHour()
        {
            var page      = new AlarmsFormPage();
            var alarmTime = System.DateTime.Now.AddHours(1);

            page.AlarmToEdit = new BobTheDigitalAssistant.Models.Alarm(-1, "", alarmTime, false, false);
            page.PopulateFormFromAlarm();
            Assert.IsTrue(page.ValidateTime());
        }
Esempio n. 2
0
        public void TestValidateTimeReturnsFalseForPastHourAndFutureMinute()
        {
            var page      = new AlarmsFormPage();
            var alarmTime = System.DateTime.Now.AddHours(-1).AddMinutes(10);

            page.AlarmToEdit = new BobTheDigitalAssistant.Models.Alarm(-1, "", alarmTime, true, false);
            page.PopulateFormFromAlarm();
            Assert.IsFalse(page.ValidateTime());
        }
Esempio n. 3
0
        public void TestValidateTimeReturnsFalseForPastMinute()
        {
            var page      = new AlarmsFormPage();
            var alarmTime = System.DateTime.Now.AddMinutes(-1);

            page.AlarmToEdit = new Capstone.Models.Alarm(-1, "", alarmTime, true, false);
            page.PopulateFormFromAlarm();
            Assert.IsFalse(page.ValidateTime());
        }
Esempio n. 4
0
        public void TestValidateTimeReturnsTrueIfDayIsSetForFuture()
        {
            var page = new AlarmsFormPage();
            // setting the day in the future but the time in the past to ensure the day overrides everything
            var alarmTime = System.DateTime.Now.AddDays(1).AddHours(-1).AddMinutes(-1);

            page.AlarmToEdit = new BobTheDigitalAssistant.Models.Alarm(-1, "", alarmTime, true, false);
            page.PopulateFormFromAlarm();
            Assert.IsTrue(page.ValidateTime());
        }