Пример #1
0
    def test_bingo_check_bingo_card_that_has_checked_all_his_numbers(self):
        # We are going to allow the player to join after the start (I think this is not allowed in the real life)
        numbers = self.call_twenty_five_numbers()
        columns = self.create_column_with(numbers)
        card = BingoCard(columns)

        self.assertTrue(self.bingo.check_card(card))
Пример #2
0
    def test_bingo_card_should_not_check_a_non_existing_number(self):
        columns = self.generate_columns()
        card = BingoCard(columns)

        card.check_number(120)
        self.assertTrue(120 not in card.checked)
Пример #3
0
    def test_bingo_card_check_an_existing_number(self):
        columns = self.generate_columns()
        card = BingoCard(columns)

        card.check_number(1)
        self.assertTrue(1 in card.checked)
Пример #4
0
    def test_bingo_card_return_none_when_column_doesnt_exists(self):
        columns = self.generate_columns()
        card = BingoCard(columns)

        self.assertEqual(None, card.get_column(10))
Пример #5
0
    def test_bingo_card_return_column_that_exists(self):
        columns = self.generate_columns()

        card = BingoCard(columns)
        self.assertEqual(columns[0], card.get_column(0))
        self.assertEqual(columns[1], card.get_column(1))
Пример #6
0
    def test_bingo_card_return_all_his_numbers(self):
        columns = self.generate_columns()

        card = BingoCard(columns)
        self.assertEqual(25, len(card.get_card_numbers()))
Пример #7
0
    def test_bingo_card_should_not_check_a_non_existing_number(self):
        columns = self.generate_columns()
        card = BingoCard(columns)

        card.check_number(120)
        self.assertTrue(120 not in card.checked)
Пример #8
0
    def test_bingo_card_check_an_existing_number(self):
        columns = self.generate_columns()
        card = BingoCard(columns)

        card.check_number(1)
        self.assertTrue(1 in card.checked)
Пример #9
0
    def test_bingo_card_return_none_when_column_doesnt_exists(self):
        columns = self.generate_columns()
        card = BingoCard(columns)

        self.assertEqual(None, card.get_column(10))
Пример #10
0
    def test_bingo_card_return_column_that_exists(self):
        columns = self.generate_columns()

        card = BingoCard(columns)
        self.assertEqual(columns[0], card.get_column(0))
        self.assertEqual(columns[1], card.get_column(1))
Пример #11
0
    def test_bingo_check_bingo_card_that_has_not_checked_all_his_numbers(self):
        numbers = [i for i in range(1, 76)]
        card = BingoCard(self.create_column_with(numbers[1:25]))

        self.assertFalse(self.bingo.check_card(card))
Пример #12
0
    def test_bingo_card_return_all_his_numbers(self):
        columns = self.generate_columns()

        card = BingoCard(columns)
        self.assertEqual(25, len(card.get_card_numbers()))