예제 #1
0
 def test_new_hand(self):
     # get new hand cards
     player1 = {
         'name': 'player one',
         'health': 30,
         'deck': 2 * [deck_building_card.Card('Baker', (3, 0), 2)],
         'hand': [deck_building_card.Card('Archer', (3, 0), 2)],
         'active': [],
         'handsize': 2,
         'discard': []
     }
     deck_building_card.act_end(player1)
     self.assertEqual(2, len(player1['hand']))
예제 #2
0
 def test_empty_active(self):
     # remove all the cards in active area
     player1 = {
         'name': 'player one',
         'health': 30,
         'deck': 10 * [deck_building_card.Card('Archer', (3, 0), 2)],
         'hand': [],
         'active': [deck_building_card.Card('Archer', (3, 0), 2)],
         'handsize': 5,
         'discard': []
     }
     deck_building_card.act_end(player1)
     self.assertEqual([], player1['active'])
예제 #3
0
 def test_hand(self):
     # test the hand is empty
     money = 0
     attack = 0
     player1 = {
         'name': 'player one',
         'health': 30,
         'deck': [],
         'hand': [deck_building_card.Card('Archer', (3, 0), 2)],
         'active': [],
         'handsize': 5,
         'discard': []
     }
     deck_building_card.act_play_all(money, attack, player1)
     self.assertEqual([], player1['hand'])
예제 #4
0
 def test_player_get_value(self):
     # test the change of money and attack values
     money = 0
     attack = 0
     player1 = {
         'name': 'player one',
         'health': 30,
         'deck': [],
         'hand': [deck_building_card.Card('Archer', (3, 0), 2)],
         'active': [],
         'handsize': 5,
         'discard': []
     }
     money, attack = deck_building_card.\
         act_play_all(money, attack, player1)
     self.assertEqual((3, 0), (attack, money))
예제 #5
0
 def test_correct_input(self):
     act = 1
     money = 0
     attack = 0
     player1 = {
         'name': 'player one',
         'health': 30,
         'deck': [],
         'hand': [deck_building_card.Card('Archer', (3, 0), 2)],
         'active': [],
         'handsize': 5,
         'discard': []
     }
     money, attack = \
         deck_building_card.\
             act_play_single_card(act, money, attack, player1)
     self.assertEqual([], player1['hand'])
예제 #6
0
 def test_out_range_input(self):
     # input value out of the number of hand cards
     act = 3
     money = 0
     attack = 0
     player1 = {
         'name': 'player one',
         'health': 30,
         'deck': [],
         'hand': [deck_building_card.Card('Archer', (3, 0), 2)],
         'active': [],
         'handsize': 5,
         'discard': []
     }
     money, attack = \
         deck_building_card.\
             act_play_single_card(act, money, attack, player1)
     self.assertEqual(1, len(player1['hand']))
예제 #7
0
 def test_cost(self):
     cost = deck_building_card.Card('Archer', (3, 0), 2).cost
     self.assertEqual(2, cost)
예제 #8
0
 def test_name(self):
     name = deck_building_card.Card('Archer', (3, 0), 2).name
     self.assertEqual("Archer", name)
예제 #9
0
 def test_money(self):
     money = deck_building_card.Card('Archer', (3, 0), 2).get_money()
     self.assertEqual(0, money)
예제 #10
0
 def test_attack(self):
     attack = deck_building_card.Card('Archer', (3, 0), 2).get_attack()
     self.assertEqual(3, attack)