class GradeTests(unittest.TestCase): def setUp(self): self.g = Grade("A") def test_get_grade(self): self.assertEqual(5, self.g.get_grade()) def test_get_grade_with_sign(self): grade = Grade("B+") self.assertEqual(4.3, grade.get_grade())
def test_get_grade_with_sign(self): grade = Grade("B+") self.assertEqual(4.3, grade.get_grade())
def setUp(self): self.g = Grade("A")
def test_get_average_score(self): self.st.add_quiz(Grade("B")) self.assertEqual(9 / 2, self.st.get_average_score())
def test_add_quiz(self): self.st.add_quiz(Grade("A")) self.assertEqual(2, self.st.get_scores_count()) self.assertEqual(10, self.st.get_total_score())