public void ComputesAverageGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(10);
            book.AddGrade(90);
            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(50, result.AverageGrade, 0.01);
        }
Example #2
0
        public void ComputesHighestGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(10);
            book.AddGrade(90);
            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(90, result.HighestGrade);
        }
        public void ComputeLowestGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(10);
            book.AddGrade(90);
            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(result.LowestGrade, 10);
        }
Example #4
0
        public void ComputerStatisticsEmpty()
        {
            GradeBook book = new GradeBook();

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(0, result.average);
            Assert.AreEqual(0, result.lowest);
            Assert.AreEqual(0, result.highest);
        }
        public void ComputesLowestGrade()
        {
            GradeBook testbook = new GradeBook();

            testbook.AddGrade(10);
            testbook.AddGrade(90);
            GradeStatistics result = testbook.ComputeStatistics();

            Assert.AreEqual(10, result.LowestGrade);
        }
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 ComputeLowestGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(95);
            book.AddGrade(45);

            GradeStatistics results = book.ComputeStatistics();

            Assert.AreEqual(45, results.LowestGrade);
        }
        public void ComputesLetterGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(90);
            book.AddGrade(80);

            GradeStatistics result = book.ComputeStatistics();

            Assert.Equal("B", result.LetterGrade);
        }
Example #10
0
        public void LetterGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(100);
            book.AddGrade(100);

            GradeStatistics grades = book.ComputeStatistics();

            Assert.AreEqual("A", grades.LetterGrade);
        }
Example #11
0
        public void CalculatesHighestGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(90f);
            book.AddGrade(50f);

            GradeStatistics stats = book.ComputeStatistics();

            Assert.AreEqual(90f, stats.HighestGrade);
        }
Example #12
0
        public void CalculatesHighestGrade()
        {
            IGradeTracker book = new GradeBook();

            book.AddGrade(59);
            book.AddGrade(99.166f);

            var actualHighestGrade = book.ComputeStatistics().HighestGrade;

            Assert.Equal(99.2, actualHighestGrade, precision: 1);
        }
Example #13
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 #14
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);
        }
        public void ComputeAverage2Grade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(91.1f);
            book.AddGrade(89.5f);
            book.AddGrade(89.5f);
            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(result.AverageGrade, 90.03, 0.01);
        }
        public void ComputesLowestGrade()
        {
            GradeBook book = new GradeBook();

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

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(10, result.LowestGrade); //is 10 equal to the lowest grade
        }
Example #17
0
        public void CalculateHighestGrade()
        {
            var book = new GradeBook();

            book.AddGrade(90f);
            book.AddGrade(50f);

            GradeStatistics stats = book.ComputeStatistics();

            Assert.AreEqual("Not set", book.Name);
        }
Example #18
0
        public void ComputeLetterGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(100);
            book.AddGrade(100);

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual("A", result.LetterGrade);
        }
Example #19
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 #20
0
        public void ComputesHighestGrade()
        {
            GradeBook grade = new GradeBook();

            grade.AddGrade(90);
            grade.AddGrade(10);

            GradeStatistics stats = grade.ComputeStatistics();

            Assert.AreEqual(90, stats.HighestGrade);
        }
Example #21
0
        public void ComputeLowestGrade()
        {
            GradeTracker book = new GradeBook();

            book.AddGrade(90);
            book.AddGrade(70);

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(70, result.LowestGrade);
        }
Example #22
0
        public void TestLowestGrade()
        {
            GradeBook book = new GradeBook();

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

            GradeStatistics result = book.ComputeStatistics();

            Assert.Equal(10, result.LowestGrade);
        }
Example #23
0
        public void CalculatesAverageGrade()
        {
            IGradeTracker book = new GradeBook();

            book.AddGrade(75);
            book.AddGrade(89);

            var actualAverageGrade = book.ComputeStatistics().AverageGrade;

            Assert.Equal(82, actualAverageGrade);
        }
Example #24
0
        public void ComputesHighestGrade()
        {
            GradeBook gradebook = new GradeBook();

            gradebook.AddGrade(100);
            gradebook.AddGrade(25);

            GradeStatistics result = gradebook.ComputeStatistics();

            Assert.AreEqual(100, result.HighestGrade);
        }
Example #25
0
        public void ComputeHighestGrade()
        {
            GradeBook book = new GradeBook();

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

            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(90, result.HighestGrade); // this checks that  HighestGrade from my app is producing the right result.
        }
Example #26
0
        public void ComputesLowestGrade()
        {
            GradeBook book = new GradeBook();

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

            GradeStatistics stats = book.ComputeStatistics();

            Assert.AreEqual(10, stats.LowestGrade);
        }
Example #27
0
        public void Description()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(50);
            book.AddGrade(50);

            GradeStatistics grades = book.ComputeStatistics();

            Assert.AreEqual("Fail", grades.Description);
        }
Example #28
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 #29
0
        public void ComputeAverageGrade()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(91);
            book.AddGrade(89.5f);
            book.AddGrade(75);
            GradeStatistics result = book.ComputeStatistics();

            Assert.AreEqual(85.166666, result.AverageGrade, 0.01);
        }
        public void GradeDescription()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(85);
            book.AddGrade(90);

            GradeBookStatistics stats = book.ComputeStatistics();

            Assert.AreEqual("Above-Average", stats.GradeDescription);
        }