Exemplo n.º 1
0
def test_has_card_should_return_false_when_user_has_no_cards(person, turtle):
    cards = []
    player = Player(person, turtle, cards)

    actual = player.has_card(Card(0, 'RED', 'PLUS'))

    assert not actual
Exemplo n.º 2
0
def test_add_card_should_add_card_for_player_with_one_card(person, turtle):
    player = Player(person, turtle, [Card(0, 'RED', 'PLUS')])
    card = Card(1, 'RED', 'MINUS')

    player.add_card(card)

    assert player.has_card(card)
Exemplo n.º 3
0
def test_add_card_should_add_card_for_player_with_no_cards(person, turtle):
    card = Card(0, 'RED', 'PLUS')
    player = Player(person, turtle, [])

    player.add_card(card)

    assert player.has_card(card)
Exemplo n.º 4
0
def test_has_card_returns_true_when_has_card_in_two_cards(person, turtle):
    cards = [Card(0, 'RED', 'PLUS'), Card(1, 'RED', 'MINUS')]
    player = Player(person, turtle, cards)

    actual = player.has_card(cards[0])

    assert actual
Exemplo n.º 5
0
def test_has_card_should_return_true_when_user_has_given_card(person, turtle):
    card = Card(0, 'RED', 'PLUS')
    player = Player(person, turtle, [card])

    actual = player.has_card(card)

    assert actual
Exemplo n.º 6
0
def test_player_shouldnt_have_card_after_its_removal(person, turtle):
    card = Card(0, 'RED', 'PLUS')
    cards = [card, Card(1, 'RED', 'MINUS')]
    player = Player(person, turtle, cards)

    player.remove_card(card)

    assert not player.has_card(card)