static void Main() { var student = new Student { Birthday = DateTime.Parse("01.03.1994"), Exams = new List<Exam> { new Exam {DisciplineName = "English", Mark = 6, Date = DateTime.Parse("03.12.2015")}, new Exam {DisciplineName = "Math", Mark = 3, Date = DateTime.Parse("03.05.2015")}, new Exam {DisciplineName = "Physics", Mark = 7, Date = DateTime.Parse("03.21.2015")}, new Exam {DisciplineName = "Biology", Mark = 5, Date = DateTime.Parse("03.17.2015")} }, Education = Education.Bachelor }; Console.WriteLine($"Source student:\n{student}\n"); Console.WriteLine("Sorted exams by discipline name:\n"); student.SortExamsByDisciplineName(); Console.WriteLine(student); Console.WriteLine(); Console.WriteLine("Sorted exams by mark:\n"); student.SortExamsByMark(); Console.WriteLine(student); Console.WriteLine(); Console.WriteLine("Sorted exams by date:\n"); student.SortExamsByDate(); Console.WriteLine(student); Console.WriteLine(); var students = new StudentCollection<string>(s => s.PersonId.ToString()); students.AddDefaults(2); var student2 = new Student { Education = Education.Bachelor, Exams = new List<Exam> { new Exam {DisciplineName = "English", Mark = 4, Date = DateTime.Parse("03.12.2015")}, new Exam {DisciplineName = "Math", Mark = 7, Date = DateTime.Parse("03.05.2015")}, new Exam {DisciplineName = "Physics", Mark = 9, Date = DateTime.Parse("03.21.2015")}, new Exam {DisciplineName = "Biology", Mark = 10, Date = DateTime.Parse("03.17.2015")} } }; var student3 = new Student { Education = Education.Bachelor, Exams = new List<Exam> { new Exam {DisciplineName = "English", Mark = 7, Date = DateTime.Parse("03.12.2015")}, new Exam {DisciplineName = "Math", Mark = 4, Date = DateTime.Parse("03.05.2015")}, new Exam {DisciplineName = "Physics", Mark = 8, Date = DateTime.Parse("03.21.2015")}, new Exam {DisciplineName = "Biology", Mark = 6, Date = DateTime.Parse("03.17.2015")} } }; students.AddStudents(student, student2, student3); Console.WriteLine($"StudentCollection<string>:\n{students}"); Console.WriteLine(); Console.WriteLine($"StudentCollection<string>(short):\n{students.ToShortString()}"); Console.WriteLine(); Console.WriteLine($"Max average mark: {students.MaxAverageMark}\n"); Console.WriteLine("The list of Bachelors:"); var bachelors = students.GetWithEducationForm(Education.Bachelor); foreach (var bachelor in bachelors) { Console.WriteLine(bachelor.Value); } Console.WriteLine(); Console.WriteLine("Grouping by education:"); var grouped = students.GroupByEducation; foreach (var group in grouped) { Console.WriteLine($"{group.Key}:"); foreach (var item in group) { Console.WriteLine(item.Value); } Console.WriteLine(); } var testCollections = new TestCollections<Person, Student>(5, count => { var tempStudent = new Student(); return new KeyValuePair<Person, Student>(tempStudent.Key, tempStudent); }); for (var att = 0; att < TestAttemptsCount; att++) { Console.WriteLine($"************************ TEST {att} ************************"); testCollections.PerformSearch(testCollections.Value, tuple => Console.WriteLine($"{tuple.Item1} : {tuple.Item2}")); Console.WriteLine(); } }