public void TestDismissStudent()
 {
     Course newCourse = new Course("Math");
     Student newStudent = new Student("Ivan", 1);
     newCourse.EnrollStudent(newStudent);
     newCourse.DismissStudent(newStudent);
 }
        public void TestEnrollStudentInvalidOperationException2()
        {
            Course newCourse = new Course("Math");

            for (int i = 0; i < 33; i++)
            {
                Student newStudent = new Student("Ivan", i);
                newCourse.EnrollStudent(newStudent);
            }
        }
        public void TestEnrollStudentInvalidOperationException1()
        {
            Course newCourse = new Course("Math");

            Student newStudent = new Student("Ivan", 1);
            newCourse.EnrollStudent(newStudent);

            Student newStudent2 = new Student("Ivan", 1);
            newCourse.EnrollStudent(newStudent2);
        }
Example #4
0
 /// <summary>
 /// Adds new students in the school
 /// First of all one student should be registered in particular school before attending any courses.
 /// </summary>
 /// <param name="student"></param>
 public void AddStudent(string name)
 {
     int id = this.GetNextFreeId();
     Student newStudent = new Student(name, id);
     this.Students.Add(id, newStudent);
 }
 public void TestStudentCtor()
 {
     Student newStudent = new Student("Ivan", 1);
 }
 public void TestNameArgumentException()
 {
     Student newStudent = new Student(null, 1);
 }
 public void TestGetName()
 {
     Student newStudent = new Student("Ivan", 1);
     string getName = newStudent.Name;
     Assert.AreEqual("Ivan", getName);
 }
 public void TestGetId()
 {
     Student newStudent = new Student("Ivan", 1);
     int getId = newStudent.Id;
     Assert.AreEqual(1, getId);
 }