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

            Assert.IsTrue(conflicts.Count == 0);
        }
        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"));
        }
Exemple #3
0
        private void _courseRepository_CourseCollectionModified(object sender, NotifyCollectionChangedEventArgs e)
        {
            List <Conflict> conflicts = _courseConflictFinder.AllConflicts();

            OnCourseConflict?.Invoke(_instance, new CourseConflictEventArgs(conflicts));
        }