public void TestSchoolAddingNewCourseShouldProperlyUpdateList()
 {
     School school = new School("OMG");
     school.AddCourse(new Course("JS-OOP"));
     school.AddCourse(new Course("JS-Basic"));
     Assert.AreEqual(2, school.Courses.Count, "List of courses is icorrect");
 }
 public void TestSchoolAddingCourseWithSameNameToThrow()
 {
     School school = new School("OMG");
     Course js = new Course("JS-OOP");
     school.AddCourse(js);
     school.AddCourse(js);
 }
Exemplo n.º 3
0
 public void SchoolShouldRemoveCourseCorrectly()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.AddCourse(course);
     school.RemoveCourse(course);
     Assert.AreEqual(0, school.Courses.Count);
 }
 public void AddCourseShouldAddTheCourse()
 {
     List<Course> courses = new List<Course>();
     List<Student> students = new List<Student>();
     School IodaSchool = new School(courses);
     string name = "Math";
     Course newCourse = new Course(students, name);
     IodaSchool.AddCourse(newCourse);
 }
 public void RemoveCourseShouldRemoveCourseThatAlreadyExist()
 {
     string name = "English";
     List<Student> students = new List<Student>();
     Course newCourse = new Course(students,name);
     List<Course> courses = new List<Course>();
     School IodaSchool = new School(courses);
     IodaSchool.AddCourse(newCourse);
     IodaSchool.RemoveCourse(newCourse);
 }
 public void RemoveCourseShouldThrowErrorIfCourseDoesNotExist()
 {
     string name = "English";
     List<Student> students = new List<Student>();
     Course newCourse = new Course(students, name);
     Course newCourse2 = new Course(students, name + 2);
     List<Course> courses = new List<Course>();
     School IodaSchool = new School(courses);
     IodaSchool.AddCourse(newCourse);
     IodaSchool.RemoveCourse(newCourse2);
 }
 public void AddCoursesShouldThrowErrorIfCoursesAreMoreThanMaxCourses()
 {
     List<Course> courses = new List<Course>();
     School IodaSchool = new School(courses);
     List<Student> students = new List<Student>();
     
     for (int i = 0; i < 35; i++)
     {
         Course newCourse = new Course(students, ("English"+i));
         IodaSchool.AddCourse(newCourse);
     }
 }
 public void TestSchoolAddingCoursetWithNull()
 {
     School school = new School("OMG");
     school.AddCourse(null);
 }
 public void TestSchoolAddingCourseToBeValid()
 {
     School school = new School("OMG");
     school.AddCourse(new Course("JS"));
 }
Exemplo n.º 10
0
 public void SchoolShouldThrowExceptionWhenExistingCourseAdded()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.AddCourse(course);
     school.AddCourse(course);
 }
Exemplo n.º 11
0
 public void StudentShouldAddCourseCorrectly()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.AddCourse(course);
     Assert.AreSame(course, school.Courses.First());
 }
Exemplo n.º 12
0
 public void SchoolShouldThrowExceptionWhenNullCourseAdded()
 {
     var school = new School("Telerik Academy");
     var course = new Course(null);
     school.AddCourse(course);
 }