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())
def test_GivenAGameWithEmptyWaste_whenmoveFromWasteToStock_ThenError(self): game = GameBuilder().stockNotEmpty().build() self.assertEqual(game.moveFromWasteToStock(), Error.EMPTY_WASTE)
def test_GivenAGameWithNotEmptyStock_whenmoveFromWasteToStock_ThenError(self): game = GameBuilder().wasteNotEmpty().build() self.assertEqual(game.moveFromWasteToStock(), Error.NO_EMPTY_STOCK)