Example #1
0
        public void ComputeLowestGrade()
        {
            GradeBook grades = new GradeBook();

            grades.Add(10.5f);
            grades.Add(90.5f);
            GradeStatistics result = grades.ComputeStatistics();

            Assert.AreEqual(50.5, result.AverageGrade);
        }
Example #2
0
        public void ComputeHighestGrade()
        {
            GradeBook grades = new GradeBook();

            grades.Add(10);
            grades.Add(90);
            GradeStatistics result = grades.ComputeStatistics();

            Assert.AreEqual(90, result.HighestGrade);
        }
Example #3
0
        public void LetterGradeFDescriptionTest()
        {
            var grades = new GradeBook();

            grades.Add(40);
            grades.Add(50);
            grades.Add(44);
            var stats = grades.ComputeStatistics();

            Assert.AreEqual("Fail", stats.Description);
        }
Example #4
0
        public void LetterGradeDDescriptionTest()
        {
            var grades = new GradeBook();

            grades.Add(60);
            grades.Add(60);
            grades.Add(65);
            var stats = grades.ComputeStatistics();

            Assert.AreEqual("Average", stats.Description);
        }
Example #5
0
        public void LetterGradeCDescriptionTest()
        {
            var grades = new GradeBook();

            grades.Add(70);
            grades.Add(70);
            grades.Add(75);
            var stats = grades.ComputeStatistics();

            Assert.AreEqual("Good", stats.Description);
        }
Example #6
0
        public void LetterGradeADescriptionTest()
        {
            var grades = new GradeBook();

            grades.Add(99);
            grades.Add(99);
            grades.Add(99);
            var stats = grades.ComputeStatistics();

            Assert.AreEqual("Excellent", stats.Description);
        }
Example #7
0
        public void LetterGradeFTest()
        {
            var grades = new GradeBook();

            grades.Add(40);
            grades.Add(50);
            grades.Add(44);
            var stats = grades.ComputeStatistics();

            Assert.AreEqual("F", stats.LetterGrade);
        }
Example #8
0
        public void LetterGradeDTest()
        {
            var grades = new GradeBook();

            grades.Add(60);
            grades.Add(60);
            grades.Add(65);
            var stats = grades.ComputeStatistics();

            Assert.AreEqual("D", stats.LetterGrade);
        }
Example #9
0
        public void ComputeWhenZeroGrade()
        {
            GradeBook grades = new GradeBook();

            grades.Add(0);
            grades.Add(0);
            GradeStatistics result = grades.ComputeStatistics();

            Assert.AreEqual(0, result.HighestGrade);
            Assert.AreEqual(0, result.AverageGrade);
            Assert.AreEqual(0, result.LowestGrade);
        }