コード例 #1
0
        public void ComputeLowestGrade()
        {
            ThrowAwayGradeBook book = new ThrowAwayGradeBook();

            book.AddGrades(10);
            book.AddGrades(90);

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(10, result.LowestGrade);
        }
コード例 #2
0
        public void ComputesHighestGrade()
        {
            GradeBook book = new ThrowAwayGradeBook();

            book.AddGrade(10);
            book.AddGrade(90);

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(90, result.HighestGrade);
        }
コード例 #3
0
        public void ComputeAverageGrade()
        {
            ThrowAwayGradeBook book = new ThrowAwayGradeBook();

            book.AddGrades(91);
            book.AddGrades(89.5f);
            book.AddGrades(75);

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(85.16, result.AverageGrade, 0.01);
        }