public void CourseShouldThrowIfStudentAlreadyAdded() { var course = new Course("Maths"); var student = new Student("unnamed", Student.MinValidId); student.JoinCourse(course); student.JoinCourse(course); }
public void StudentShouldNotThrowWhenLeavingCourse() { var course = new Course("testCourse"); var st = new Student("Pesho", 15000); st.JoinCourse(course); st.LeaveCourse(course); }
public void CourseShouldAddStudent() { var course = new Course("Maths"); var student = new Student("unnamed", Student.MinValidId); student.JoinCourse(course); Assert.AreEqual(1, course.Students.Count); }
public void StudentProperlyJoinsCourse() { var student = new Student("pesho", 22222); var course = new Course("math"); student.JoinCourse(course); Assert.IsTrue(course.Students.Contains(student), "Student is not added to course"); }
public void CourseShouldThrowIfStudentsAreMoreThanMaxAllowed() { var course = new Course("Maths"); for (int i = 0; i <= Course.MaxStudentsCount; i++) { var student = new Student("unnamed", Student.MinValidId+i); student.JoinCourse(course); } }
public void StudentProperlyLeavesCourse() { var student = new Student("pesho", 22222); var course = new Course("math"); student.JoinCourse(course); student.LeaveCourse(course); Assert.IsFalse(course.Students.Contains(student), "Student is still in the course"); }
public void Course_AddingMoreThan29Students() { School mySchool = new School(); Course art = new Course(); for (int i = 1; i <= 35; i++) { Student student = new Student("Ivan Ivanov", i + 10000, mySchool); student.JoinCourse(art); } Assert.Fail("Course takes only 29 students"); }
public void StudentGroupShouldAddOnlyNewNotAlreadyAddedStudentsFromNewCourseOnNewCourseAdd() { var myClass = new StudentGroup("TelerikAcad"); var newCourse = new Course("HQC"); var existingStudent = new Student("Existing Guy", Student.MinValidId); var newStudent = new Student("New Guy", Student.MinValidId+1); newStudent.JoinCourse(newCourse); myClass.AddStudent(existingStudent); myClass.AddCourse(newCourse); Assert.AreEqual(2, myClass.Students.Count); }
public void Course_LeavingCourse() { School mySchool = new School(); Course art = new Course(); for (int i = 1; i <= 15; i++) { Student student = new Student("Ivan Ivanov", i + 10000, mySchool); student.JoinCourse(art); student.LeaveCourse(art); } Assert.IsTrue(art.Members.Count == 0); }
public void StudentSHouldThrowWehnJoiningNullCourse() { var st = new Student("Pesho", 15000); st.JoinCourse(null); }
public void Student_JoinCourse() { School mySchool = new School(); Course biology = new Course(); Student gosho = new Student("gosho", 48000, mySchool); gosho.JoinCourse(biology); }
public void StudentCanNotJoinNullCourse() { var student = new Student("pesho", 22222); student.JoinCourse(null); }