Пример #1
0
        /// <summary>
        /// Search for available slots for a room.
        /// </summary>
        /// <param name="searchParameters">The search parameters for a course to fina n available room.</param>
        public void Search(SearchParameters searchParameters)
        {
            List <ScheduleSlot> slots = roomSearch.ScheduleSlotsAvailable(searchParameters);

            AvailableSlots.Clear();

            foreach (var slot in slots)
            {
                AvailableSlots.Add(slot);
            }
        }
Пример #2
0
        public void AvailableSlots()
        {
            var courseRepo = new NonConflictingCourseRepo();
            var roomRepo   = new RoomRepo();
            var roomSearch = new AvailableRoomSearch(roomRepo, courseRepo);

            SearchParameters searchParameters;

            searchParameters.MeetingDays = new List <DayOfWeek>()
            {
                DayOfWeek.Monday, DayOfWeek.Wednesday
            };
            searchParameters.Capacity  = 10;
            searchParameters.Duration  = new TimeSpan(1, 0, 0);
            searchParameters.StartTime = new TimeSpan(13, 0, 0);
            searchParameters.EndTime   = new TimeSpan(20, 0, 0);

            List <ScheduleSlot> slots = roomSearch.ScheduleSlotsAvailable(searchParameters);

            Assert.AreEqual <int>(3, slots.Count);
        }