public void IsRoomAvaliable_WithCorrectTimeSlot_ReturnTrue()
        {
            // Arrange
            List <Reservation> reservations = DataGenerator.GetValidReservations();
            int      roomId = 1;
            DateTime from   = new DateTime(2020, 9, 20, 11, 30, 0);
            DateTime to     = new DateTime(2020, 9, 20, 12, 0, 0);


            // Act
            var result = Validator.IsRoomAvaliable(roomId, from, to, reservations);

            // Assert
            Assert.AreEqual(result, true);
        }
        public void IsRoomAvaliable_WithLargeTimeSlot_ReturnFalse()
        {
            // as room cannot be avalaible during all this period since a meeting between 10 and 11 is scheduled
            // Arrange
            List <Reservation> reservations = DataGenerator.GetValidReservations();
            int      roomId = 1;
            DateTime from   = new DateTime(2020, 9, 20, 1, 0, 0);
            DateTime to     = new DateTime(2020, 9, 20, 12, 0, 0);


            // Act
            var result = Validator.IsRoomAvaliable(roomId, from, to, reservations);

            // Assert
            Assert.AreEqual(result, false);
        }
Beispiel #3
0
        public void GetAllAvaliableRooms_WithCorrectDate_ReturnAllAvaliableRooms_AtAmsterdamOffice()
        {
            // Arrange
            var mockService = MockSettings.GetService_With_Offices_Rooms_Reservations(DataGenerator.GetValidOffices(),
                                                                                      DataGenerator.GetValidRoomsForOffice(),
                                                                                      DataGenerator.GetValidReservations());
            var      meetingScheduler = new MeetingsScheduler(mockService.Object);
            DateTime from             = new DateTime(2020, 9, 20, 8, 0, 0);
            DateTime to = new DateTime(2020, 9, 20, 9, 0, 0);

            // Act
            var result = meetingScheduler.GetAllAvaliableRooms(2, from, to);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, 1);
            Assert.AreEqual(result[0].RoomId, 5);
        }