public static void Main(string[] args)
        {
            Discipline mathematic          = new Discipline("Mathematic", 10, 10);
            Discipline courseCSharpPartOne = new Discipline("C# Part One", 6, 1);
            Discipline courseCSharpPartTwo = new Discipline("C# Part Two", 9, 2);

            List <Discipline> peshosListOfDisciplines = IninializeListOfDisciplines(mathematic, courseCSharpPartOne, courseCSharpPartTwo);

            List <Discipline> goshosListOfDisciplines = IninializeListOfDisciplines(courseCSharpPartOne, courseCSharpPartTwo);

            Teacher teacherPesho = new Teacher("Pesho", peshosListOfDisciplines);
            Teacher teacherGosho = new Teacher("Gosho", goshosListOfDisciplines);

            List <Teacher> listOfTeachers = new List <Teacher>();

            listOfTeachers.Add(teacherPesho);
            listOfTeachers.Add(teacherGosho);

            Student studentGencho = new Student("Gencho", 1);
            Student studentPencho = new Student("Pencho", 1);

            List <Student> listOfStudents = new List <Student>();

            listOfStudents.Add(studentGencho);
            listOfStudents.Add(studentPencho);

            Class firstClass = new Class("First class identifier", listOfStudents, listOfTeachers);

            List <Class> listOfClasses = new List <Class>();

            listOfClasses.Add(firstClass);

            School epicSchool = new School(listOfClasses);

            System.Console.WriteLine(epicSchool.ToString());
        }
Beispiel #2
0
        public void TestToString()
        {
            School school = new School();
            Course course = new Course("Chemistry");
            course.AddStudent(new Student("Hari", 123));
            course.AddStudent(new Student("Joe", 124));
            school.AddCourse(course);

            string expectedOutput = "Course name: Chemistry" + Environment.NewLine +
                "Student: Hari, number: 123." + Environment.NewLine +
                "Student: Joe, number: 124.";
            Assert.AreEqual(expectedOutput, school.ToString());
        }