예제 #1
0
        public void HasConflict_False()
        {
            ICourseRepository     courseRepository = new NonConflictingCourseRepo();
            ConflictDetectorTests detector         = new ConflictDetector(courseRepository);
            ConflictResult        result           = detector.FindConflicts();

            Assert.IsFalse(result.HasConflicts);
        }
예제 #2
0
        public void OnRoomAvailable()
        {
            IRoomRepository   roomRepo   = new RoomRepo();
            ICourseRepository courseRepo = new NonConflictingCourseRepo();

            AvailableRoomSearch roomSearch = new AvailableRoomSearch(roomRepo, courseRepo);
            var meetingDays = new List <DayOfWeek>()
            {
                DayOfWeek.Monday, DayOfWeek.Wednesday
            };
            var startingTime   = new TimeSpan(12, 0, 0);
            var endingTime     = new TimeSpan(13, 35, 0);
            var minCapacity    = 40;
            var availableRooms = roomSearch.AvailableRooms(meetingDays, startingTime, endingTime, minCapacity);

            //Assert.AreEqual<int>(1, availableRooms.Count);
            //Assert.AreEqual<string>("PKI 158", availableRooms[0].RoomName);
        }
예제 #3
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);
        }
예제 #4
0
 public void RoomRepoNull_ThrowsException()
 {
     IRoomRepository     roomRepo   = null;
     ICourseRepository   courseRepo = new NonConflictingCourseRepo();
     AvailableRoomSearch roomSearch = new AvailableRoomSearch(roomRepo, courseRepo);
 }