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

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

            Assert.That(caughtException, Is.InstanceOf <InvalidWorkingDaysException>());
        }
Ejemplo 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>());
        }
Ejemplo 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>());
        }