Ejemplo n.º 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");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 6
0
 public void ExpectAddStudentToSchoolToThrowWhenAddingANullValue()
 {
     var school = new School();
     school.AddStudent(null);
 }
Ejemplo n.º 7
0
 public void ExpectAddCourseToSchoolToThrowWhenAddingANullValue()
 {
     var school = new School();
     school.AddCourse(null);
 }