public void OnNoConflict_DetectorReturnEmptyList()
        {
            AssignmentConflictDetector detector  = new AssignmentConflictDetector(nonConflictingCourseRepo);
            List <Conflict>            conflicts = detector.AllConflicts();

            Assert.IsTrue(conflicts.Count == 0);
        }
示例#2
0
        private NotificationManager(CourseRepository courseRepository, AssignmentConflictDetector roomConflictFinder)
        {
            //_courseRepository = courseRepository;
            //_courseConflictFinder = roomConflictFinder;

            //_courseRepository.CourseModified += NotificationManager_CourseModified;
            //_courseRepository.CourseCollectionModified += _courseRepository_CourseCollectionModified;
        }
        public void OnConflict_AllConflicts_ReturnsCorrectConflict()
        {
            AssignmentConflictDetector detector  = new AssignmentConflictDetector(conflictingCourseRepo);
            List <Conflict>            conflicts = detector.AllConflicts();

            Assert.IsTrue(conflicts.Count == 1);
            var conflictingCourses = conflicts.First().ConflictingCourses;

            Assert.AreEqual <int>(2, conflictingCourses.Count);
            Assert.IsTrue(conflictingCourses.Exists(x => x.ClassID == "240"));
            Assert.IsTrue(conflictingCourses.Exists(x => x.ClassID == "241"));
        }