public void GradeBook_AddGrade_AddsGradeToGradesList() { var book = new InMemoryGradeBook("test"); book.AddGrade(30.0); var expected = 30.0; var actual = book.GetGradeBookStatistics().Average; Assert.Equal(expected, actual); }
public void GradeBook_GetGradeBookStatistics_CalculatesStatsFromGradeBookList() { // Arrange InMemoryGradeBook book = new InMemoryGradeBook(""); book.AddGrade(89.1); book.AddGrade(90.5); book.AddGrade(77.3); // Act var result = book.GetGradeBookStatistics(); // Assert Assert.Equal(85.6, result.Average, 1); Assert.Equal(90.5, result.High, 1); Assert.Equal(77.3, result.Low, 1); Assert.Equal('B', result.LetterGrade); }