Esempio n. 1
0
        public void CannnotCreateWorkingCalendarWithNullWorkingDays()
        {
            ProjectCalendarFactory calendarFactory = new ProjectCalendarFactory();

            Exception caughtException = Assert.Catch(() => calendarFactory.CreateWorkingCalendar(null));

            Assert.That(caughtException, Is.InstanceOf <InvalidWorkingDaysException>());
        }
Esempio n. 2
0
        public void CannnotCreateWorkingCalendarWithGreaterThan24WorkingHoursPerDay()
        {
            ProjectCalendarFactory calendarFactory = new ProjectCalendarFactory();

            Exception caughtException = Assert.Catch(() => calendarFactory.CreateWorkingCalendar(
                                                         new WorkingDay[] { new WorkingDay(DayOfWeek.Monday, 25) }
                                                         ));

            Assert.That(caughtException, Is.InstanceOf <InvalidWorkingHoursPerDayException>());
        }
Esempio n. 3
0
        public void CannnotCreateWorkingCalendarWithRepeatedWorkingDays()
        {
            ProjectCalendarFactory calendarFactory = new ProjectCalendarFactory();

            Exception caughtException = Assert.Catch(() => calendarFactory.CreateWorkingCalendar(
                                                         new WorkingDay[] { new WorkingDay(DayOfWeek.Monday, 8), new WorkingDay(DayOfWeek.Monday, 8) }
                                                         ));

            Assert.That(caughtException, Is.InstanceOf <InvalidWorkingDaysException>());
        }