def test_GivenAGame_WhenmoveFromWasteToFoundationAndWasteEmpty_ThenError(self): game = GameBuilder().build() self.assertEqual(game.moveFromWasteToFoundation(Suit.PIKES), Error.EMPTY_WASTE)
def test_GivenAGame_WhenmoveFromWasteToFoundationAndDontFit_ThenError(self): game = GameBuilder().wasteWithAce(Suit.PIKES).build() self.assertEqual(game.moveFromWasteToFoundation(Suit.CLOVERS), Error.NO_FIT_FOUNDATION)
def test_GivenAGame_WhenmoveFromWasteToFoundationAndFits_ThenTheCardisMoved(self): game = GameBuilder().wasteWithAce(Suit.PIKES).build() cardTobeMoved = game.getWaste().getTop() self.assertIsNone(game.moveFromWasteToFoundation(Suit.PIKES)) self.assertEqual(game.getFoundations()[Suit.PIKES].getTop(), cardTobeMoved)