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); }
public void TestCourseAddStudent() { var students = new List<Student>(); var course = new Course(students); var anotherStudent = new Student("Adam"); course.AddStudent(anotherStudent); Assert.AreEqual(students.Count + 1, course.Students.Count); }
public void ExpectIDvalueToNotOverFlow() { var listOfStudents = new List<Student>(); for (int i = 0; i < 100003; i++) { var randomName = i.ToString(); var student = new Student(randomName); listOfStudents.Add(student); } var course = new Course(listOfStudents); }
public void ExpectedMaxStudentsCountToNotExceedThirty() { var listOfStudents = new List<Student>(); for (int i = 0; i < 33; i++) { var randomName = i.ToString(); var student = new Student(randomName); listOfStudents.Add(student); } var course = new Course(listOfStudents); }