public void NotAwardPotToFoldedPlayerWithWinningHand() { var log = new List <string>(); var gameState = new GameState(); var withoutPair = new MockPlayer("NoPair", 1000, 1); var withPairWillFold = new MockPlayer("FoldsPair", 1000, 2); withPairWillFold.PlayerActionWhenRequested = new PlayerAction("Fold", 0); gameState.Players = new List <Player>() { withoutPair, withPairWillFold }; var mockDeck = new MockDeck(); mockDeck.PushCardOntoDeck(new Card('C', 11)); mockDeck.PushCardOntoDeck(new Card('S', 5)); mockDeck.PushCardOntoDeck(new Card('D', 7)); mockDeck.PushCardOntoDeck(new Card('H', 7)); Hand.Play(gameState, log, mockDeck); Assert.True(withoutPair.Chips > withPairWillFold.Chips); }
public void AwardPotToPlayerWithHighPair() { var log = new List <string>(); var gameState = new GameState(); var player1 = new MockPlayer("Billy", 1000, 1); var player2 = new MockPlayer("John", 1000, 2); var player3 = new MockPlayer("Steve", 1000, 3); gameState.Players = new List <Player>() { player1, player2, player3 }; var mockDeck = new MockDeck(); mockDeck.PushCardOntoDeck(new Card('C', 14)); mockDeck.PushCardOntoDeck(new Card('S', 14)); mockDeck.PushCardOntoDeck(new Card('C', 5)); mockDeck.PushCardOntoDeck(new Card('S', 5)); mockDeck.PushCardOntoDeck(new Card('D', 2)); mockDeck.PushCardOntoDeck(new Card('H', 2)); Hand.Play(gameState, log, mockDeck); Assert.True(player3.Chips > player1.Chips); Assert.True(player3.Chips > player2.Chips); }
public void AwardPotToPlayerWithPair() { var log = new List <string>(); var gameState = new GameState(); var withoutPair = new MockPlayer("Billy", 1000, 1); var withPair = new MockPlayer("John", 1000, 2); gameState.Players = new List <Player>() { withoutPair, withPair }; var mockDeck = new MockDeck(); mockDeck.PushCardOntoDeck(new Card('C', 11)); mockDeck.PushCardOntoDeck(new Card('S', 5)); mockDeck.PushCardOntoDeck(new Card('D', 7)); mockDeck.PushCardOntoDeck(new Card('H', 7)); Hand.Play(gameState, log, mockDeck); Assert.True(withPair.Chips > withoutPair.Chips); }