Esempio n. 1
0
 def test_adding_students_to_different_grades_adds_them_to_the_same_sorted_roster(
         self):
     school = School()
     school.add_student(name="Chelsea", grade=3)
     school.add_student(name="Logan", grade=7)
     expected = ["Chelsea", "Logan"]
     self.assertEqual(school.roster(), expected)
 def test_adding_more_students_adds_them_to_sorted_roster(self):
     school = School()
     school.add_student(name='Blair', grade=2)
     school.add_student(name='James', grade=2)
     school.add_student(name='Paul', grade=2)
     expected = ['Blair', 'James', 'Paul']
     self.assertEqual(school.roster(), expected)
Esempio n. 3
0
 def test_adding_more_student_adds_them_to_the_sorted_roster(self):
     school = School()
     school.add_student(name="Blair", grade=2)
     school.add_student(name="James", grade=2)
     school.add_student(name="Paul", grade=2)
     expected = ["Blair", "James", "Paul"]
     self.assertEqual(school.roster(), expected)
Esempio n. 4
0
 def test_adding_more_students_adds_them_to_sorted_roster(self):
     school = School()
     school.add_student(name='Blair', grade=2)
     school.add_student(name='James', grade=2)
     school.add_student(name='Paul', grade=2)
     expected = ['Blair', 'James', 'Paul']
     self.assertEqual(school.roster(), expected)
Esempio n. 5
0
    def test_students_in_multiple_grades_are_added_to_the_roster(self):
        school = School()
        school.add_student(name="Chelsea", grade=3)
        school.add_student(name="Logan", grade=7)
        expected = ["Chelsea", "Logan"]

        self.assertEqual(school.roster(), expected)
Esempio n. 6
0
 def test_multiple_students_in_the_same_grade_are_added_to_the_roster(self):
     school = School()
     school.add_student(name="Blair", grade=2)
     school.add_student(name="James", grade=2)
     school.add_student(name="Paul", grade=2)
     expected = ["Blair", "James", "Paul"]
     self.assertEqual(school.roster(), expected)
Esempio n. 7
0
    def test_students_are_sorted_by_grades_in_the_roster(self):
        school = School()
        school.add_student(name="Jim", grade=3)
        school.add_student(name="Peter", grade=2)
        school.add_student(name="Anna", grade=1)
        expected = ["Anna", "Peter", "Jim"]

        self.assertEqual(school.roster(), expected)
Esempio n. 8
0
    def test_students_are_sorted_by_name_in_the_roster(self):
        school = School()
        school.add_student(name="Peter", grade=2)
        school.add_student(name="Zoe", grade=2)
        school.add_student(name="Alex", grade=2)
        expected = ["Alex", "Peter", "Zoe"]

        self.assertEqual(school.roster(), expected)
Esempio n. 9
0
    def test_student_not_added_to_same_grade_in_the_roster_more_than_once(self):
        school = School()
        school.add_student(name="Blair", grade=2)
        school.add_student(name="James", grade=2)
        school.add_student(name="James", grade=2)
        school.add_student(name="Paul", grade=2)
        expected = ["Blair", "James", "Paul"]

        self.assertEqual(school.roster(), expected)
Esempio n. 10
0
 def test_student_names_with_grades_are_displayed_in_the_same_sorted_roster(self):
     school = School()
     school.add_student(name="Peter", grade=2)
     school.add_student(name="Anna", grade=1)
     school.add_student(name="Barb", grade=1)
     school.add_student(name="Zoe", grade=2)
     school.add_student(name="Alex", grade=2)
     school.add_student(name="Jim", grade=3)
     school.add_student(name="Charlie", grade=1)
     expected = ["Anna", "Barb", "Charlie", "Alex", "Peter", "Zoe", "Jim"]
     self.assertEqual(school.roster(), expected)
Esempio n. 11
0
 def test_roster_is_sorted_by_grade_then_name(self):
     school = School()
     for name, grade in [
         ("Peter", 2),
         ("Anna", 1),
         ("Barb", 1),
         ("Zoe", 2),
         ("Alex", 2),
         ("Jim", 3),
         ("Charlie", 1),
     ]:
         school.add_student(name, grade)
     expected = ["Anna", "Barb", "Charlie", "Alex", "Peter", "Zoe", "Jim"]
     self.assertEqual(school.roster(), expected)
Esempio n. 12
0
 def test_roster_is_sorted_by_grade_then_name(self):
     school = School()
     for name, grade in [
         ('Peter', 2),
         ('Anna', 1),
         ('Barb', 1),
         ('Zoe', 2),
         ('Alex', 2),
         ('Jim', 3),
         ('Charlie', 1),
     ]:
         school.add_student(name, grade)
     expected = ['Anna', 'Barb', 'Charlie', 'Alex', 'Peter', 'Zoe', 'Jim']
     self.assertEqual(school.roster(), expected)
Esempio n. 13
0
 def test_roster_is_sorted_by_grade_then_name(self):
     school = School()
     for name, grade in [
         ('Peter', 2),
         ('Anna', 1),
         ('Barb', 1),
         ('Zoe', 2),
         ('Alex', 2),
         ('Jim', 3),
         ('Charlie', 1),
     ]:
         school.add_student(name, grade)
     expected = ['Anna', 'Barb', 'Charlie', 'Alex', 'Peter', 'Zoe', 'Jim']
     self.assertEqual(school.roster(), expected)
Esempio n. 14
0
 def test_students_in_different_grades_in_same_roster(self):
     school = School()
     school.add_student(name='Chelsea', grade=3)
     school.add_student(name='Logan', grade=7)
     expected = ['Chelsea', 'Logan']
     self.assertEqual(school.roster(), expected)
Esempio n. 15
0
 def test_roster_returns_an_empty_list_if_there_are_no_students_enrolled(
         self):
     school = School()
     expected = []
     self.assertEqual(school.roster(), expected)
Esempio n. 16
0
 def test_adding_student_adds_them_to_sorted_roster(self):
     school = School()
     school.add_student(name='Aimee', grade=2)
     expected = ['Aimee']
     self.assertEqual(school.roster(), expected)
Esempio n. 17
0
 def test_students_in_different_grades_in_same_roster(self):
     school = School()
     school.add_student(name='Chelsea', grade=3)
     school.add_student(name='Logan', grade=7)
     expected = ['Chelsea', 'Logan']
     self.assertEqual(school.roster(), expected)
Esempio n. 18
0
 def test_students_in_different_grades_in_same_roster(self):
     school = School()
     school.add_student(name="Chelsea", grade=3)
     school.add_student(name="Logan", grade=7)
     expected = ["Chelsea", "Logan"]
     self.assertEqual(school.roster(), expected)
Esempio n. 19
0
 def test_roster_is_empty_when_no_student_is_added(self):
     school = School()
     expected = []
     self.assertEqual(school.roster(), expected)
Esempio n. 20
0
 def test_adding_a_student_adds_them_to_the_sorted_roster(self):
     school = School()
     school.add_student(name="Aimee", grade=2)
     expected = ["Aimee"]
     self.assertEqual(school.roster(), expected)
Esempio n. 21
0
 def test_student_is_added_to_the_roster(self):
     school = School()
     school.add_student(name="Aimee", grade=2)
     expected = ["Aimee"]
     self.assertEqual(school.roster(), expected)