public void ClassbookOfFourRankingWithGrade() { Classbook classbook = new Classbook(); classbook.AddStudent(new Student("John")); classbook.AddStudent(new Student("Marry")); classbook.AddStudent(new Student("Linda")); classbook.AddStudent(new Student("Mike")); var john = classbook.FindStudent("John"); var marry = classbook.FindStudent("Marry"); var linda = classbook.FindStudent("Linda"); var mike = classbook.FindStudent("Mike"); john.ReceiveGrade("Biology", 6); john.ReceiveGrade("Biology", 8); john.ReceiveGrade("Chemistry", 8); marry.ReceiveGrade("Maths", 10); marry.ReceiveGrade("Biology", 8); marry.ReceiveGrade("Chemistry", 8); linda.ReceiveGrade("Maths", 7); linda.ReceiveGrade("Biology", 5); mike.ReceiveGrade("Chemistry", 10); Assert.Equal(1, classbook.Rank("Mike")); Assert.Equal(2, classbook.Rank("Marry")); Assert.Equal(3, classbook.Rank("John")); Assert.Equal(4, classbook.Rank("Linda")); }
public void AverageSubjectGradeForAStudentInClassbook() { Classbook classbook = new Classbook(); classbook.AddStudent(new Student("John")); classbook.AddStudent(new Student("Marry")); classbook.AddStudent(new Student("Linda")); classbook.AddStudent(new Student("Mike")); var john = classbook.FindStudent("John"); var marry = classbook.FindStudent("Marry"); var linda = classbook.FindStudent("Linda"); var mike = classbook.FindStudent("Mike"); john.ReceiveGrade("Biology", 6); john.ReceiveGrade("Biology", 8); john.ReceiveGrade("Chemistry", 8); marry.ReceiveGrade("Maths", 10); marry.ReceiveGrade("Biology", 8); marry.ReceiveGrade("Chemistry", 8); linda.ReceiveGrade("Maths", 7); linda.ReceiveGrade("Biology", 5); mike.ReceiveGrade("Chemistry", 10); var biology = john.FindSubject("Biology"); Assert.Equal(7, biology.AverageSubjectGrade()); }