Ejemplo n.º 1
0
 public void CreatingCourseShouldThrowArgumentExceptionWhenProvidedTooLongName()
 {
     var tooLongName = new string('a', 101);
     var course = new Course(tooLongName);
 }
Ejemplo n.º 2
0
 public void CreatingCourseShouldThrowArgumentExceptionWhenProvidedNameWithNullValue()
 {
     var course = new Course(null);
 }
Ejemplo n.º 3
0
 private Course GetValidCourse()
 {
     var course = new Course("Valid");
     return course;
 }
Ejemplo n.º 4
0
 public void CreatingCourseShouldThrowArgumentExceptionWhenProvidedEmptyName()
 {
     var course = new Course(string.Empty);
 }
Ejemplo n.º 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.");
            }
        }