public void TestAddStudentRemoveStudent() { Course course = new Course("Math"); Student student = new Student("Pesho"); course.AddStudent(new Student("Gosho")); Assert.AreEqual(course.Students.Count, 1); course.AddStudent(student); Assert.AreEqual(course.Students.Count, 2); Assert.AreEqual(course.Students[1].Name, "Pesho"); course.RemoveStudent(student); Assert.AreEqual(course.Students.Count, 1); Assert.AreEqual(course.Students[0].Name, "Gosho"); }
public void RemoveStudentTest() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); Student maria = new Student("Maria Petrova", 12345); Student petar = new Student("Petar Marinov", 23445); course.AddStudent(maria); course.AddStudent(petar); course.RemoveStudent(petar); Assert.IsTrue(course.Students.Count == 1); }
public void RemoveNonExistingStudentTest() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); Student maria = new Student("Maria Petrova", 12345); course.RemoveStudent(maria); }
public void TestRemoveStudentExceptionWhenNotExisting() { Course course = new Course("Math"); Student studentOne = new Student("Pesho"); Student studentTwo = new Student("Gosho"); course.AddStudent(studentOne); course.RemoveStudent(studentTwo); }