public void GetDay_ShouldBeSubsetOfGetWeek(DateTime dateTime) { ISchedule roomSchedule = new RoomSchedule(apiConfig, logger, apiCalls); string roomName = "H.1.308"; var reservationsForWeek = roomSchedule.GetWeek(dateTime, roomName); var reservationsForDay = roomSchedule.GetDay(dateTime, roomName); Assert.Contains(reservationsForDay, reservationsForWeek.Values); }
public void GetNumberOfFreeTimeslots_ShouldWork(DateTime dateTime) { ISchedule roomSchedule = new RoomSchedule(apiConfig, logger, apiCalls); string roomName = "H.1.308"; var reservations = roomSchedule.GetDay(dateTime, roomName); int expected = reservations.Where(r => r.Value == null).Count(); int actual = roomSchedule.GetNumberOfFreeTimeslots(dateTime, roomName); Assert.Equal(expected, actual); }