def test_payout_bonus_scenario_any_natural(self): calculator = Lucky9PayoutCalculator() dealer_up_card = Lucky9Card('spade', 10) player_cards = [Lucky9Card('club', 3), Lucky9Card('diamond', 6)] winning = calculator.calculate_bonus_winning(dealer_up_card, player_cards) self.assertEqual(5, winning)
def test_payout_bonus_scenario_suited_9(self): calculator = Lucky9PayoutCalculator() dealer_up_card = Lucky9Card('club', 1) player_cards = [Lucky9Card('club', 2), Lucky9Card('club', 6)] winning = calculator.calculate_bonus_winning(dealer_up_card, player_cards) self.assertEqual(30, winning)
def test_payout_bonus_scenario_suited_2_3_4(self): calculator = Lucky9PayoutCalculator() dealer_up_card = Lucky9Card('spade', 3) player_cards = [Lucky9Card('spade', 2), Lucky9Card('spade', 4)] winning = calculator.calculate_bonus_winning(dealer_up_card, player_cards) self.assertEqual(100, winning)
def test_payout_bonus_lose(self): calculator = Lucky9PayoutCalculator() dealer_up_card = Lucky9Card('spade', 2) player_cards = [Lucky9Card('spade', 3), Lucky9Card('club', 7)] winning = calculator.calculate_bonus_winning(dealer_up_card, player_cards) self.assertEqual(0, winning)
def test_payout_bet_dealer_not_enough_cards(self): calculator = Lucky9PayoutCalculator() dealer_cards = [Lucky9Card('spade', 2)] player_cards = [ Lucky9Card('spade', 1), Lucky9Card('spade', 3), Lucky9Card('spade', 4) ] self.assertRaises(ValueError, calculator.calculate_bet_winning, dealer_cards, player_cards)
def test_payout_bet_player_wins_natural_9_dealer_not_9(self): calculator = Lucky9PayoutCalculator() dealer_cards = [ Lucky9Card('club', 1), Lucky9Card('diamond', 2), Lucky9Card('club', 3) ] player_cards = [ Lucky9Card('spade', 10), Lucky9Card('club', 3), Lucky9Card('spade', 5) ] winning = calculator.calculate_bet_winning(dealer_cards, player_cards) self.assertEqual(1.5, winning)
def test_payout_bet_dealer_total_9_player_lucky_9(self): calculator = Lucky9PayoutCalculator() dealer_cards = [ Lucky9Card('club', 10), Lucky9Card('diamond', 7), Lucky9Card('club', 2) ] player_cards = [ Lucky9Card('spade', 2), Lucky9Card('club', 3), Lucky9Card('spade', 4) ] winning = calculator.calculate_bet_winning(dealer_cards, player_cards) self.assertEqual(1.5, winning)
def test_payout_bet_dealer_more_than_player(self): calculator = Lucky9PayoutCalculator() dealer_cards = [ Lucky9Card('spade', 2), Lucky9Card('club', 3), Lucky9Card('spade', 4) ] player_cards = [ Lucky9Card('club', 1), Lucky9Card('diamond', 2), Lucky9Card('club', 3) ] winning = calculator.calculate_bet_winning(dealer_cards, player_cards) self.assertEqual(0, winning)
def test_payout_tie_scenario_win(self): calculator = Lucky9PayoutCalculator() dealer_cards = [ Lucky9Card('spade', 1), Lucky9Card('spade', 2), Lucky9Card('spade', 3) ] player_cards = [ Lucky9Card('club', 6), Lucky9Card('diamond', 6), Lucky9Card('spade', 4) ] winning = calculator.calculate_tie_winning(dealer_cards, player_cards) self.assertEqual(7, winning)
def test_payout_bonus_dealer_no_cards(self): calculator = Lucky9PayoutCalculator() dealer_up_card = None player_cards = [Lucky9Card('spade', 3), Lucky9Card('spade', 3)] self.assertRaises(ValueError, calculator.calculate_bonus_winning, dealer_up_card, player_cards)
def test_payout_bonus_player_not_enough_cards(self): calculator = Lucky9PayoutCalculator() dealer_up_card = Lucky9Card('spade', 1) player_cards = [Lucky9Card('spade', 2)] self.assertRaises(ValueError, calculator.calculate_bonus_winning, dealer_up_card, player_cards)