public void Test_CourseJoinStudentTwiceShouldThrow()
 {
     var st = new Student(VALID_NAME, VALID_NUMBER);
     var course = new Course();
     course.Join(st);
     course.Join(st);
 }
        public void Test_AddTooManyStudentsShouldThrow()
        {
            var course = new Course();

            for (int i = 0; i < 50; i++)
            {
                var st = new Student(VALID_NAME, VALID_NUMBER + 1);
                course.Join(st);
            }
        }
 public void Test_SchoolWithValidCourse()
 {
     try
     {
         var course = new Course();
         var school = new School();
         school.Add(course);
     }
     catch (Exception ex)
     {
         Assert.Fail("Expected no exception, but got: " + ex.Message);
     }
 }
 public void Test_CourseWithValidStudentShouldNotThrow()
 {
     var st = new Student(VALID_NAME, VALID_NUMBER);
     var course = new Course();
     try
     {
         course.Join(st);
         course.Leave(st);
     }
     catch (Exception ex)
     {
         Assert.Fail("Expected no exception, but got: " + ex.Message);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// The add.
 /// </summary>
 /// <param name="course">
 /// The course.
 /// </param>
 /// <exception cref="ArgumentException">
 /// </exception>
 public void Add(Course course)
 {
     this.courses.Add(course);
 }
 public void Test_LeaveNotExistingStudentShouldThrow()
 {
     var st = new Student(VALID_NAME, VALID_NUMBER);
     var course = new Course();
     course.Leave(st);
 }
 /// <summary>
 /// The add.
 /// </summary>
 /// <param name="course">
 /// The course.
 /// </param>
 /// <exception cref="ArgumentException">
 /// </exception>
 public void Add(Course course)
 {
     this.courses.Add(course);
 }