Beispiel #1
0
 public void CreatingCourseShouldThrowArgumentExceptionWhenProvidedTooLongName()
 {
     var tooLongName = new string('a', 101);
     var course = new Course(tooLongName);
 }
Beispiel #2
0
 public void CreatingCourseShouldThrowArgumentExceptionWhenProvidedNameWithNullValue()
 {
     var course = new Course(null);
 }
Beispiel #3
0
 private Course GetValidCourse()
 {
     var course = new Course("Valid");
     return course;
 }
Beispiel #4
0
 public void CreatingCourseShouldThrowArgumentExceptionWhenProvidedEmptyName()
 {
     var course = new Course(string.Empty);
 }
Beispiel #5
0
        public void RemoveCourseShouldRemoveRightCourseWhenRemovingFromMultiple()
        {
            var validNames = new string[3] { "Java", "C#", "C++" };
            var school = GetValidSchool();
            var firstCourse = new Course(validNames[0]);
            var secondCourse = new Course(validNames[1]);
            var thirdCourse = new Course(validNames[2]);

            school.AddCourse(firstCourse);
            school.AddCourse(secondCourse);
            school.AddCourse(thirdCourse);
            school.RemoveCourse(firstCourse);

            for (int i = 0; i < school.Courses.Count; i++)
            {
                var currCourse = school.Courses[i];
                Assert.AreNotEqual(firstCourse, currCourse, "Removing course failed.");
            }
        }