コード例 #1
0
 public void CourseAlreadyAddedInSchoolTest()
 {
     School school = new School();
     Course sampleCourse = new Course("Javascript");
     school.AddCourse(sampleCourse);
     school.AddCourse(sampleCourse);
 }
コード例 #2
0
 public void RemoveNonexistingCourseTest()
 {
     School school = new School();
     Course registeredCourse = new Course("Javascript");
     Course notRegisteredCourse = new Course("PHP");
     school.AddCourse(registeredCourse);
     school.RemoveCourse(notRegisteredCourse);
 }
コード例 #3
0
 public void AddSchoolCourseTest()
 {
     School school = new School();
     Course sampleCourse = new Course("Javascript");
     school.AddCourse(sampleCourse);
     var schoolCourses = school.GetCourses();
     Assert.IsTrue(schoolCourses.Length == 1);
     Assert.AreEqual(sampleCourse, schoolCourses[0]);
 }
コード例 #4
0
 public void RemoveSchoolCourseTest()
 {
     School school = new School();
     Course sampleCourse = new Course("Javascript");
     school.AddCourse(sampleCourse);
     var schoolCourses = school.GetCourses();
     Assert.AreEqual(1, schoolCourses.Length);
     school.RemoveCourse(sampleCourse);
     var schoolCoursesUpdated = school.GetCourses();
     Assert.AreEqual(0, schoolCoursesUpdated.Length);
 }
コード例 #5
0
 public void AddNullCourseToSchool()
 {
     School school = new School();
     school.AddCourse(null);
 }