Пример #1
0
        public void shouldCountAllReservations()
        {
            Table table = new Table(5);

            table.CreateReservation(new TimeSpan(10, 0, 0), new TimeSpan(12, 0, 0), 4);
            table.CreateReservation(new TimeSpan(14, 0, 0), new TimeSpan(16, 0, 0), 4);
            table.Reservations.Count.Should().Be(2);
        }
Пример #2
0
        public void shouldFailOverlapping()
        {
            Table table = new Table(5);

            table.CreateReservation(new TimeSpan(12, 0, 0), new TimeSpan(22, 0, 0), 4);
            Action action = () => table.CreateReservation(new TimeSpan(14, 0, 0), new TimeSpan(22, 0, 0), 4);

            action.ShouldThrow <BusinessException>();
        }
Пример #3
0
        public void shouldFailNumberOfPeopleGreaterThanCapacity()
        {
            Table  table  = new Table(5);
            Action action = () => table.CreateReservation(new TimeSpan(14, 0, 0), new TimeSpan(20, 0, 0), 6);

            action.ShouldThrow <BusinessException>();
        }
Пример #4
0
        public void shouldFailStartDateOffHours()
        {
            Table  table  = new Table(5);
            Action action = () => table.CreateReservation(new TimeSpan(8, 0, 0), new TimeSpan(22, 0, 0), 4);

            action.ShouldThrow <BusinessException>();
        }
Пример #5
0
        public void shouldCreateReservation()
        {
            Table table = new Table(5);

            table.CreateReservation(new TimeSpan(10, 0, 0), new TimeSpan(22, 0, 0), 4);
            table.Reservations.Should().NotBeNullOrEmpty();
        }