示例#1
0
        public void BookCalculatesAnAverageGradesFromCLIInput()
        {
            // arrange
            var book = new InMemoryBook("InMemoryBook of Water");

            book.AddGrade(60);
            book.AddGrade(90);
            book.AddGrade(70);
            book.AddGrade(60);
            book.AddGrade(10);
            book.AddGrade(10);
            // act
            var result = book.GetStatistics();

            //assert
            Assert.Equal(book.GetMaxGradeCount(), book.GetGrades().Count);
            Assert.Equal(280, result.Total);
            Assert.Equal(70, result.Average);
            Assert.Equal(90, result.High);
            Assert.Equal(60, result.Low);
            Assert.Equal('C', result.Letter);
        }