public void Player2Hands_HoldsOneHand_PlayerStatusInProgress() { var playerOne = new BlackJackPlayer(new AvitarDto() { id = "8625cf04-b7e2", userName = playerName }, HandIdentifierProvider, 2); var blkJkJackClubs = new BlackJackCard(jackClubs, true); var handId = new GuidBasedHandIdentifierProviderMock().GenerateHandIds(1).Single(); playerOne.Status = PlayerStatusTypes.Ready; playerOne.DealHands(twoThreeClubs2X); playerOne.Hit(handId, blkJkJackClubs); playerOne.Hold(handId); Assert.AreEqual(PlayerStatusTypes.InProgress, playerOne.Status); }
public void Player_HoldsCard_PlayerStatusComplete() { var playerOne = new BlackJackPlayer(new AvitarDto() { id = "8625cf04-b7e2", userName = playerName }, HandIdentifierProvider, 1); var blkJkTwoClubs = new BlackJackCard(twoClubs, true); var blkJkThreeClubs = new BlackJackCard(threeClubs, false); var blkJkJackClubs = new BlackJackCard(jackClubs, true); var handId = new GuidBasedHandIdentifierProviderMock().GenerateHandIds(1).Single(); playerOne.Hit(handId, blkJkTwoClubs); playerOne.Hit(handId, blkJkThreeClubs); playerOne.Hit(handId, blkJkJackClubs); playerOne.Hold(handId); Assert.AreEqual(PlayerStatusTypes.Complete, playerOne.Status); }
public void PlayerSingleHand_DealAndHitAndHold_CorrectInstanceValues() { var playerId = "8625cf04-b7e2"; var playerOne = new BlackJackPlayer(new AvitarDto() { id = "8625cf04-b7e2", userName = playerName }, HandIdentifierProvider, 1); var blkJkJackClubs = new BlackJackCard(jackClubs, true); var handId = new GuidBasedHandIdentifierProviderMock().GenerateHandIds(1).Single(); playerOne.Status = PlayerStatusTypes.Ready; playerOne.DealHands(twoThreeClubs); Assert.AreEqual(PlayerStatusTypes.InProgress, playerOne.Status); playerOne.Hit(handId, blkJkJackClubs); Assert.AreEqual(true, playerOne.Hands.Single(h => h.Identifier == handId).Cards.ElementAt(0).FaceDown); Assert.AreEqual(false, playerOne.Hands.Single(h => h.Identifier == handId).Cards.ElementAt(1).FaceDown); Assert.AreEqual(false, playerOne.Hands.Single(h => h.Identifier == handId).Cards.ElementAt(2).FaceDown); Assert.AreEqual(15, playerOne.Hands.Single(h => h.Identifier == handId).PointValue); Assert.AreEqual(PlayerStatusTypes.InProgress, playerOne.Status); Assert.AreEqual(playerId, playerOne.Identifier); Assert.AreEqual(1, playerOne.Hands.Count()); Assert.AreEqual(HandStatusTypes.InProgress, playerOne.Hands.Single(h => h.Identifier == handId).Status); playerOne.Hold(handId); Assert.AreEqual(true, playerOne.Hands.Single(h => h.Identifier == handId).Cards.ElementAt(0).FaceDown); Assert.AreEqual(false, playerOne.Hands.Single(h => h.Identifier == handId).Cards.ElementAt(1).FaceDown); Assert.AreEqual(false, playerOne.Hands.Single(h => h.Identifier == handId).Cards.ElementAt(2).FaceDown); Assert.AreEqual(15, playerOne.Hands.Single(h => h.Identifier == handId).PointValue); Assert.AreEqual(PlayerStatusTypes.Complete, playerOne.Status); Assert.AreEqual(playerId, playerOne.Identifier); Assert.AreEqual(1, playerOne.Hands.Count()); Assert.AreEqual(HandStatusTypes.Hold, playerOne.Hands.Single(h => h.Identifier == handId).Status); }