예제 #1
0
        public void ExpectAddingStudentsToSchoolToAddThemCorrectly()
        {
            var school = new School();
            var billy = new Student("Billy", 10000);

            school.AddStudent(billy);
            Assert.AreEqual(school.Students[0], billy, "Expect the add method to add valid students correctly");
        }
예제 #2
0
        public void ExpectRemoveStudentInSchoolToRemoveAnAddedStudent()
        {
            var school = new School();
            var billy = new Student("Billy", 10000);
            school.AddStudent(billy);
            school.RemoveStudent(billy);

            Assert.AreEqual(school.Students.Count, 0, "Expects the students list to be empty");
        }
예제 #3
0
        public void ExpectAddStudentToSchoolToThrowWhenAddingADuplicatedID()
        {
            var school = new School();
            var billy = new Student("Billy", 10000);
            var willy = new Student("Willy", 10000);

            school.AddStudent(billy);
            school.AddStudent(willy);
        }
예제 #4
0
        public void ExpectAddCourseToAddTheCourse()
        {
            var school = new School();
            var course = new Course();
            var billy = new Student("Billy", 10000);
            course.AddStudent(billy);

            school.AddCourse(course);

            Assert.AreEqual(school.Courses[0], course, "Expected the school to have an added course");
        }
예제 #5
0
        public void ExpectRemoveCourseToRemoveTheCourse()
        {
            var school = new School();
            var course = new Course();
            var billy = new Student("Billy", 10000);
            course.AddStudent(billy);

            school.AddCourse(course);
            school.RemoveCourse(course);

            Assert.AreEqual(school.Courses.Count, 0, "Expected the school to have an empty course list");
        }
예제 #6
0
 public void ExpectAddStudentToSchoolToThrowWhenAddingANullValue()
 {
     var school = new School();
     school.AddStudent(null);
 }
예제 #7
0
 public void ExpectAddCourseToSchoolToThrowWhenAddingANullValue()
 {
     var school = new School();
     school.AddCourse(null);
 }