示例#1
0
 def test_GivenAGameWithEmptyStock_whenmoveFromWasteToStock_TheCardsAreMoved(self):
     game = GameBuilder().wasteNotEmpty().stockEmpty().build()
     expected_cards = CardStackHelper.fromCardStack(game.getWaste()).flip().reverse().getCards()
     self.assertIsNone(game.moveFromWasteToStock())
     self.assertListEqual(
         CardStackHelper.fromCardStack(game.getStock()).getCards(), expected_cards)
     self.assertTrue(game.getWaste().isEmpty())
示例#2
0
 def test_GivenAGameWithEmptyWaste_whenmoveFromWasteToStock_ThenError(self):
     game = GameBuilder().stockNotEmpty().build()
     self.assertEqual(game.moveFromWasteToStock(), Error.EMPTY_WASTE)
示例#3
0
 def test_GivenAGameWithNotEmptyStock_whenmoveFromWasteToStock_ThenError(self):
     game = GameBuilder().wasteNotEmpty().build()
     self.assertEqual(game.moveFromWasteToStock(), Error.NO_EMPTY_STOCK)