Example #1
0
 def test_GivenAGame_WhenmoveFromWasteToFoundationAndWasteEmpty_ThenError(self):
     game = GameBuilder().build()
     self.assertEqual(game.moveFromWasteToFoundation(Suit.PIKES), Error.EMPTY_WASTE)
Example #2
0
 def test_GivenAGame_WhenmoveFromWasteToFoundationAndDontFit_ThenError(self):
     game = GameBuilder().wasteWithAce(Suit.PIKES).build()
     self.assertEqual(game.moveFromWasteToFoundation(Suit.CLOVERS), Error.NO_FIT_FOUNDATION)
Example #3
0
 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)