コード例 #1
0
        public void TimeOfDayClass_AddMethodWithTimeSpanAndTimeOfDayParameters_ThrowsArgumentNullExceptionIfSecondParameterIsNull()
        {
            int       testSeconds0 = _rnd.Next(86398);
            TimeSpan  testValue0   = TimeSpan.FromSeconds(testSeconds0);
            TimeOfDay testValue1   = null;

            _ = TimeOfDay.Add(testValue0, testValue1);

            Assert.Fail();
        }
コード例 #2
0
        public void TimeOfDayClass_AddMethodWithTimeSpanAndTimeOfDayParameters_ReturnsTimeOfDayWithCorrectValueIfResultDoesNotCrossMidnight()
        {
            int       testSeconds0 = _rnd.Next(86398);
            int       testSeconds1 = _rnd.Next(86399 - testSeconds0) + testSeconds0;
            TimeSpan  testValue0   = TimeSpan.FromSeconds(testSeconds0);
            TimeOfDay testValue1   = new TimeOfDay(testSeconds1);

            TimeOfDay testOutput = TimeOfDay.Add(testValue0, testValue1);

            Assert.AreEqual(testSeconds0 + testSeconds1, testOutput.AbsoluteSeconds);
        }
コード例 #3
0
ファイル: ScheduleUI.cs プロジェクト: bek15071991/Dental
        public ScheduleUI(IScheduleDataService scheduleDataService,
                          IAppointmentDataService appointmentDataService)
        {
            _scheduleDataService    = scheduleDataService;
            _appointmentDataService = appointmentDataService;

            int currYear = DateTime.Now.Year;

            Years.Add(currYear.ToString());
            Years.Add((currYear + 1).ToString());

            TimeOfDay.Add("Morning");
            TimeOfDay.Add("Noon");
            TimeOfDay.Add("Afternoon");
            TimeOfDay.Add("No Preference");
        }
コード例 #4
0
        public void TimeOfDayClass_AddMethodWithTimeSpanAndTimeOfDayParameters_ThrowsArgumentNullExceptionWithCorrectParamNamePropertyIfSecondParameterIsNull()
        {
            int       testSeconds0 = _rnd.Next(86398);
            TimeSpan  testValue0   = TimeSpan.FromSeconds(testSeconds0);
            TimeOfDay testValue1   = null;

            try
            {
                _ = TimeOfDay.Add(testValue0, testValue1);
                Assert.Fail();
            }
            catch (ArgumentNullException ex)
            {
                Assert.AreEqual("t2", ex.ParamName);
            }
        }