示例#1
0
        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");
        }
示例#2
0
 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);
 }
示例#3
0
 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);
 }
示例#4
0
 public void TestRemoveStudentExceptionWhenNotExisting()
 {
     Course course = new Course("Math");
     Student studentOne = new Student("Pesho");
     Student studentTwo = new Student("Gosho");
     course.AddStudent(studentOne);
     course.RemoveStudent(studentTwo);
 }