public static void Main()
        {
            var firstStudent = new Student("Ivan");
            var secondStudent = new Student("Pesho");
            var thirdStudent = new Student("Gosho");

            var javascriptCourse = new Course("Javascript OOP");

            var someStudents = new List<Student>();
            var someCourses = new List<Course>();

            var sch = new School(" ", someStudents, someCourses);

            Console.WriteLine(firstStudent);
            Console.WriteLine(secondStudent);
            Console.WriteLine(thirdStudent);

            javascriptCourse.AddStudent(firstStudent);
            javascriptCourse.AddStudent(secondStudent);
            javascriptCourse.AddStudent(thirdStudent);

            Console.WriteLine(javascriptCourse.StudentsInCourse.Count);

            javascriptCourse.RemoveStudent(firstStudent);

            Console.WriteLine(javascriptCourse.StudentsInCourse.Count);
            Console.WriteLine(javascriptCourse.StudentsInCourse.Contains(secondStudent));
            Console.WriteLine(secondStudent);
            Console.WriteLine(thirdStudent);
        }
Esempio n. 2
0
        public void TestCourseRemoveStudent()
        {
            var students = new List<Student>();
            var course = new Course(students);

            var student = new Student("Adam");
            course.AddStudent(student);
            course.AddStudent(student);
            course.RemoveStudent(student);
            Assert.AreEqual(students.Count + 1, course.Students.Count);
        }