public void GPACalculationPerformsAverageCalculation() { var underTest = new Student(1); underTest.RecordClassGrade(Grade.C); Assert.Equal((double)Grade.C, underTest.GradePointAverage); underTest.RecordClassGrade(Grade.C); Assert.Equal((double)Grade.C, underTest.GradePointAverage); underTest.RecordClassGrade(Grade.A); Assert.Equal((double)8/3, underTest.GradePointAverage); underTest.RecordClassGrade(Grade.A); Assert.Equal((double)Grade.B, underTest.GradePointAverage); }
public void AfterOneClassGPAReflectsSingleClass() { var underTest = new Student(1); underTest.RecordClassGrade(Grade.C); Assert.Equal((double)Grade.C, underTest.GradePointAverage); }
public void AverageOfStudentsGetsComputed() { var classoffering = new ClassOffering(new Teacher(1), (s1, s2) => 0); var s = new Student(1); s.RecordClassGrade(Grade.A); classoffering.EnrollStudent(s); s = new Student(2); s.RecordClassGrade(Grade.C); classoffering.EnrollStudent(s); var gpa = classoffering.AverageGPAForStudents(); Assert.Equal(3.0, gpa); }