public void TestCourseAddStudentMethodIfStudentIsPassedToBeAdded()
 {
     var student = new Student("aaa", 12345);
     var myCourse = new Course("aa");
     myCourse.AddStudent(student);
     Assert.AreEqual(student.ID, myCourse.Students[0].ID);
 }
 public void TestCourseRemoveStudentMethodIfValidStudentIsPassedToBeRemoved()
 {
     var student = new Student("aaa", 12345);
     var myCourse = new Course("aa");
     myCourse.AddStudent(student);
     myCourse.RemoveStudent(student);
     Assert.AreEqual(myCourse.Students.Count, 0);
 }
 public void TestCourseRemoveStudentMethodIfInvalidStudentIsPassedToBeRemoved()
 {
     var validStudent = new Student("aaa", 12345);
     var invalidStudent = new Student("we", 12345);
     var myCourse = new Course("aa");
     myCourse.AddStudent(validStudent);
     myCourse.RemoveStudent(invalidStudent);
 }
示例#4
0
        public void MaxNumberStudentsInCourse()
        {
            School mySchool = new School();
            Course math = new Course();

            for (int i = 0; i < 31; i++)
            {
                math.AddStudent(new Student("Pesho", 10000 + i, mySchool));
            }
        }
        public void TestCourseToHaveLessThan30Students()
        {
            var student = new Student("aaa", 12345);
            var myCourse = new Course("aa");
            for (int i = 0; i < 32; i++)
            {
                myCourse.AddStudent(student);
            }

            var expectedNumberOfStudentsInTheCourse = MaximalNumberOfStudentsInCourse;
            Assert.AreEqual(expectedNumberOfStudentsInTheCourse, myCourse.Students.Count);
        }
示例#6
0
        public void TryingToRemoveUnexistingStudent()
        {
            School mySchool = new School();
            Course math = new Course();

            for (int i = 0; i < 30; i++)
            {
                math.AddStudent(new Student("Pesho", 10000 + i, mySchool));
            }

            math.RemoveStudent(new Student("Gosho", 34322, mySchool));
        }
示例#7
0
        public void JointCourse(Course course)
        {
            if (course == null)
            {
                throw new ArgumentNullException("You must provide a course!");
            }

            course.AddStudent(this);
        }