static void Main() { Student goshkoStudent = new Student("Goshko", 5); goshkoStudent.AddComment("Goshko is a bad student."); Student peshoStudent = new Student("Pesho", 10); peshoStudent.AddComment("Pesho is a normal student."); Student ivanStudent = new Student("Ivan", 11); ivanStudent.AddComment("Ivan is a great student."); Discipline maths = new Discipline("Maths", 10, 10); Discipline physics = new Discipline("Physics", 5, 4); Teacher teacher = new Teacher("Borislav Petrov", new List<Discipline>() { maths, physics }); teacher.AddComment("Borislav Petrov is a very good teacher."); teacher.AddComment("Wonderful teacher."); teacher.AddComment("Teaches only useful and interesting things."); //test comments methods teacher.ShowComments(); Console.WriteLine(); teacher.RemoveComment("Wonderful teacher."); //the comments after removed one comment teacher.ShowComments(); //clear all comments and after that nothing happens teacher.ClearAllComments(); teacher.ShowComments(); Class newClass = new Class("123", new List<Teacher>() { teacher }, new List<Student>() { goshkoStudent, peshoStudent, ivanStudent }); School school = new School(new List<Class>() { newClass }); }
public void TestSchoolAddStudent() { var school = new School(); var student = new Student("Name", 12345); school.AddStudent(student); Assert.IsTrue(school.Students.Contains(student)); }
public void TestSchoolAddStudentTwice() { var school = new School(); var student = new Student("Name", 12345); school.AddStudent(student); school.AddStudent(student); }
public static void Main(string[] args) { School school = new School("Test School", "One of the best schools in the city!"); List<Student> students11A = new List<Student>() { new Student("Petar", "Petrov", 1), new Student("Ivan", "Petrov", 2), new Student("Stoian", "Ivanov", 3, "Excelant student!"), new Student("Gosho", "Toshev", 4), new Student("Stoqn", "Georgiev", 5) }; List<Teacher> teachers11A = new List<Teacher>() { new Teacher("Petar", "Georgiev", new List<Discipline>() { new Discipline("Phisycs", 12, 6, "Raquired"), new Discipline("Mathematics", 12 , 6, "Raquired") }, "Alviable only in the mornings!"), new Teacher("Ivan", "Petrov", new List<Discipline>() { new Discipline("Economics", 12, 6, "Optional"), new Discipline("Mathematics", 12 , 6, "Raquired") }, "Alviable only afternoon!"), new Teacher("Stoian", "Toshev", new List<Discipline>(){ new Discipline("Phisycs", 10, 10, "Raquired") }, "") }; school.AddSchoolClass(new SchoolClass("11A", students11A, teachers11A, "Just comment!")); Console.WriteLine(school); }
static void Main() { List<Student> students = new List<Student>() { new Student("Angel Angelov", 22, 9002120011,1), new Student("Vasil Ivanov", 22, 9012121212, 2), new Student("Nikolay Niklov", 22, 9012200014, 3), new Student("Nikolina Jekova", 22, 9011141113, 4), new Student("Julia Ribarska", 22, 9005132259, 5) }; students[3].Comment = "Play games during the class hour"; SchoolClass schoolClass = new SchoolClass("7 A"); foreach (var student in students) { schoolClass.AddStudent(student); } List<Discipline> disciplines = new List<Discipline>() { new Discipline("Computer architectures", 20, 10), new Discipline("Programin languages", 20, 10), new Discipline("Mangement of new technologies", 20, 10), new Discipline("Operating systems", 30, 15), }; foreach (var discipline in disciplines) { schoolClass.AddDiscipline(discipline); } List<Teacher> teachers = new List<Teacher>() { new Teacher("Ivan Peshev", 60, 4301010012), new Teacher("Peter Petrov", 50, 5311121112) }; teachers[0].AddDiscipline(disciplines[0]); teachers[0].AddDiscipline(disciplines[1]); teachers[1].AddDiscipline(disciplines[2]); teachers[1].AddDiscipline(disciplines[3]); foreach (var teacher in teachers) { schoolClass.AddTeacher(teacher); } School school = new School("The Alien Education"); school.AddClass(schoolClass); Console.WriteLine(school); Console.WriteLine(); Console.ResetColor(); }
public void InitializeSchool() { this.courses = new List<Course>(); this.courses.Add(new Course("HQC")); this.courses.Add(new Course("DSA")); this.courses.Add(new Course("JS UI&DOM")); this.school = new School(this.courses); }
static void Main() { #region CREATE TEST OBJ //discipline List<Disciplines> disciplines = new List<Disciplines>(); disciplines.Add(new Disciplines("Chemistry", 4, 6)); disciplines.Add(new Disciplines("Math", 10, 10)); disciplines.Add (new Disciplines("Biology", 8, 6)); disciplines.Add(new Disciplines("Insurance", 10, 6)); disciplines.Add(new Disciplines("Informatics", 10, 16)); //teachers List<Teacher> teachers = new List<Teacher>(); teachers.Add(new Teacher("Manolov",disciplines.GetRange(3,1))); teachers.Add(new Teacher("Minkov",disciplines.GetRange(0,2))); teachers.Add(new Teacher("Marinov", disciplines.GetRange(2, 1))); teachers.Add(new Teacher("Ovcharov", disciplines.GetRange(0, 3))); //students List<Student> students = new List<Student>(); students.Add(new Student("Martin", 3)); students.Add(new Student("Darin", 13)); students.Add(new Student("Rumqna", 6)); students.Add(new Student("Emil", 33)); students.Add(new Student("Nikola", 7)); students.Add(new Student("Georgi", 1)); //SchoolClasses List<SchoolClass> schoolClasses = new List<SchoolClass>(); schoolClasses.Add(new SchoolClass(teachers, students, "3133")); //school School school = new School("School Akademy",schoolClasses); #endregion //-----TEST SCHOOL------- Console.WriteLine(school); #region TEST OPTIONAL COMMENTS Student vasko = new Student("Vasko",3); vasko.FreeComments = "OPTIONAL COMMENT TEST"; vasko.ShowFreeComments(); Teacher ra = new Teacher("Vasko", disciplines); ra.FreeComments = "OPTIONAL COMMENT TEST"; ra.ShowFreeComments(); SchoolClass da = new SchoolClass(teachers,students,"31231"); da.FreeComments = "OPTIONAL COMMENT TEST"; da.ShowFreeComments(); #endregion }
public void TestSchoolCourseCount() { IList<Student> students = new List<Student>() { new Student("Pesho", 10002), new Student("Gosho", 20003), new Student("Mariq", 30004), new Student("Pettq", 10042) }; Course course = new Course(students); IList<Course> courses = new List<Course>() { course }; School school = new School(courses); Assert.AreEqual(1, school.Courses.Count, "Expected to count 1 school course."); }
public void TestSchoolRemovingCourse() { IList<Student> students = new List<Student>() { new Student("Pesho", 10002), new Student("Gosho", 20003), new Student("Mariq", 30004), new Student("Pettq", 10042) }; Course course = new Course(students); School school = new School(new List<Course>()); school.AddCourse(course); school.RemoveCourse(course); Assert.AreEqual(0, school.Courses.Count, "Expected to count 1 school course."); }
static void Main(string[] args) { School firstClass = new School(); Teacher firstTeacher = new Teacher("Ivan"); firstClass.AddTeacher(firstTeacher); Teacher secondTeacher = new Teacher("Stoian"); firstClass.AddTeacher(secondTeacher); Teacher thirdTeacher = new Teacher("Dragan"); firstClass.AddTeacher(thirdTeacher); foreach (var teacher in firstClass.Teachers) { teacher.Name = "test"; } }
public static void Main() { Discipline firstDiscipline = new Discipline("history", 2, 5); Discipline secondDiscipline = new Discipline("math", 8, 4); Student firstStudent = new Student("Daniel", 1); Student secondStudent = new Student("Ivan", 2); Teacher firstTeacher = new Teacher("Petrov", new List<Discipline> { firstDiscipline, secondDiscipline }); Class firstClass = new Class("1A", new List<Student> { firstStudent, secondStudent }, new List<Teacher> { firstTeacher }); School firstSchool = new School(new List<Class> { firstClass }); Console.WriteLine("The name of the first discipline of the first teacher in 1A class is: {0}",firstSchool.Classes[0].Teachers[0].SetOfDisciplines[0].Name); firstSchool.Classes[0].Comment = "The best students ever!"; Console.WriteLine(firstSchool.Classes[0].Comment); }
public static void School() { //creating instances of Student class Student angel = new Student("Angel Dragomirov", 1); Student ivan = new Student("Ivan Dragomirov", 11); Student georgi = new Student("Georgi Haralampiev", 7); //creating instances of Teacher class Teacher petrov = new Teacher("Kiril Petrov"); Teacher ivanov = new Teacher("Marian Ivanov"); //Adding techers knowledge disciplines petrov.Subjects.Add(Discipline.Math); petrov.Subjects.Add(Discipline.Chemistry); ivanov.Subjects.Add(Discipline.AmericanEnglish); ivanov.Subjects.Add(Discipline.BritishEnglish); //creating instance of SchoolClass class SchoolClass AClass = new SchoolClass("AClass"); //adding Students to the SchoolClass AClass.Students.Add(angel); AClass.Students.Add(ivan); AClass.Students.Add(georgi); //adding Teacher to the SchoolClass AClass.Teachers.Add(petrov); AClass.Teachers.Add(ivanov); //creating instance of School School mySchool = new School(51, "Elisaveta Bagryana"); //adding SchoolClass to the School mySchool.Classes.Add(AClass); //adding optional comment AClass.About = "Geeks"; }
public void TestSchoolRemoveStudentNull() { var school = new School(); school.RemoveStudent(null); }
public void TestSchoolRemoveMissingStudent() { var school = new School(); var student = new Student("Name", 12345); school.RemoveStudent(student); }
public void TestSchoolConstructorCreateStudentsHashSet() { var school = new School(); Assert.AreEqual(0, school.Students.Count); }
public void TestSchoolConstructorCreateCoursesList() { var school = new School(); Assert.AreEqual(0, school.Courses.Count); }
public void TestSchoolAddStudentNull() { var school = new School(); school.AddStudent(null); }
static void Main() { var students = new List<Student>() { new Student("Ivan Petrov",5), new Student ("Alex Georgiev",1), new Student ("Dimo petrov",4) }; var disciplines = new List<Disciplines>() { new Disciplines("Mathematics",12,14), new Disciplines("History", 10, 10), new Disciplines("Art",3,5) }; var teachers = new List<Teachers> { new Teachers("First Teacher"), new Teachers("Second Teacher",new Disciplines[]{disciplines[0],disciplines[1]}), new Teachers("Third Teacher",new Disciplines[]{new Disciplines("Music",7,12)}), }; var classes = new ClassesOfStudents[] { new ClassesOfStudents("class 11A",teachers[0]), new ClassesOfStudents("class 11B",new Teachers[]{teachers[1],teachers[2],(new Teachers("Fourth teacher",new Disciplines[]{(new Disciplines("Music",3,5))}))}) }; School[] schools = new School[] { new School("NPMG",classes), new School("Telerik academy",new ClassesOfStudents[]{new ClassesOfStudents("Ninja class",new Teachers[]{new Teachers("Ivo Kenov",new Disciplines[]{new Disciplines("ASP.NET",40,50)}),new Teachers("Niki Kostov",new Disciplines[]{new Disciplines("Quality Programming Code",40,50)}),new Teachers("Doncho Minkov",new Disciplines[]{new Disciplines("CSS",40,60)})})}) }; teachers[0].AddComment("Ïs on vacation for the next two weeks"); teachers[1].AddComment("Very experienced teacher"); teachers[1].AddComment("PhD in mathematics"); Console.WriteLine(new string('-', 50)); Console.WriteLine("All comments about second teacher:"); Console.WriteLine(teachers[1].GetAllComments()); Console.WriteLine("All comments about third teacher:"); Console.WriteLine(teachers[2].GetAllComments()); Console.WriteLine(new string('-',50)); teachers[2].AddComment("Good professional"); foreach (var teacher in teachers) { Console.WriteLine("Teacher:{0} \nComments:{1}",teacher.Name,teacher.GetAllComments()); } Console.WriteLine(new string('-', 50)); teachers[0].AddDiscipline(new Disciplines("Programming", 20, 50)); teachers[2].AddDiscipline(disciplines[2]); disciplines[0].AddComment("Studying linear equations"); disciplines[2].AddComment("Studying Postimpresionism"); foreach (var dis in disciplines) { Console.WriteLine(dis); } Console.WriteLine(new string('-', 50)); var teacherOneTaughtDisc=teachers[1].AllTaughtDisciplines; Console.WriteLine("First teacher teaches in:"); Console.WriteLine(string.Join(", ",teacherOneTaughtDisc)); Console.WriteLine(new string('-', 50)); foreach (var teacher in teachers) { Console.WriteLine(teacher); } Console.WriteLine(new string('-', 50)); foreach (var st in students) { Console.WriteLine(st); } Console.WriteLine(new string('-', 50)); foreach (var cls in classes) { Console.WriteLine(cls.NameOfCourse); } Console.WriteLine(new string('-', 50)); foreach (var school in schools) { Console.WriteLine(school); } Console.WriteLine(new string('-', 50)); Console.WriteLine(schools[0].GetAllTeachers()); Console.WriteLine(new string('-', 50)); Console.WriteLine("Get all courses in Telerik academy:\n"); Console.Write(string.Join("\n\n",schools[1].GetAllClasses())); Console.WriteLine(new string('-', 50)); }