public void StudentShouldSubscribeToCourseOnlyOnce() { var student = new Student("Pesho"); var course = new Course("Math"); course.Subscribe(student); course.Subscribe(student); course.Subscribe(student); Assert.AreEqual(course.Students.Count, 1); }
public void AddingCourseToStudent_ShouldPass() { var student = new Student("Pesho"); var course = new Course("Math"); course.Subscribe(student); Assert.AreEqual(course.Students.Count, 1); }
public void UnsibscribingStudentFromCourse_ShouldPass(string name) { var course = new Course("Math"); var student = new Student(name); course.Subscribe(student); course.Unsubscribe(student); Assert.AreEqual(course.Students.Count, 0); }
public void AddingMultipleStudentsToCourse() { var course = new Course("Biology"); for (int i = 0; i < 35; i++) { var student = new Student(i.ToString()); course.Subscribe(student); } Assert.AreEqual(course.Students.Count, Constants.MAX_STUDENTS_IN_COURSE); }
public void UnsubscribingNotSubscribedStudent_ShouldDoNothing() { var course = new Course("Math"); var student = new Student("Pesho"); var pesho = new Student("Pesho"); course.Subscribe(student); course.Unsubscribe(pesho); Assert.AreEqual(course.Students.Count, 1); }