Esempio n. 1
0
    def test_when_no_team_expect_cannot_be_merged(self):
        # ARRANGE
        quiz = Quiz()

        # ACT
        result = quiz.can_merge_teams([])

        # ASSERT
        self.assertFalse(result)
Esempio n. 2
0
    def test_when_only_one_team_expect_cannot_be_merged(self):
        # ARRANGE
        quiz = Quiz()
        team = quiz.get_team(1, 'team 1')

        # ACT
        result = quiz.can_merge_teams([team])

        # ASSERT
        self.assertFalse(result)
Esempio n. 3
0
    def test_when_teams_in_same_section_expect_cannot_be_merged(self):
        # ARRANGE
        quiz = Quiz()
        section = Section(quiz=quiz)
        team1 = quiz.get_team(1, 'test_1')
        section.add_response(Response(team=team1))

        team2 = quiz.get_team(2, 'test_2')
        section.add_response(Response(team=team2))

        # ACT
        result = quiz.can_merge_teams([team1, team2])

        # ASSERT
        self.assertFalse(result)
Esempio n. 4
0
    def test_when_sections_of_teams_dont_overlap_expect_can_be_merged(self):
        # ARRANGE
        quiz = Quiz()
        section1 = Section(quiz=quiz)
        team1 = quiz.get_team(1, 'test_1')
        section1.add_response(Response(team=team1))

        section2 = Section(quiz=quiz)
        team2 = quiz.get_team(2, 'test_2')
        section2.add_response(Response(team=team2))

        # ACT
        result = quiz.can_merge_teams([team1, team2])

        # ASSERT
        self.assertTrue(result)