public void TakeMoveSoftHandTest() { StandartBot bot = new StandartBot(); ToolKit.Hand hand = new ToolKit.Hand(); hand.Cards = NewSameCards(ToolKit.CardPoints.Ace); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Four)); ToolKit.Card dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Five); Assert.AreEqual(ToolKit.GamingState.Double, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Ace); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Four)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ace); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Ace); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Five); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Ace); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Nine); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Ace); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Seven)); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); }
public void HitTest() { ToolKit.Hand hand = new ToolKit.Hand(); PlayerActions.Hit(hand, dealer, shoe); Assert.AreEqual(1, hand.Cards.Count); Assert.AreEqual(ToolKit.GamingState.Hit, hand.State); }
public void DrawCardToPlayerTest() { Dealer dealer = new Dealer(); ToolKit.Hand hand = new ToolKit.Hand(); dealer.DrawCardToPlayer(shoe, hand); Assert.AreEqual(1, hand.Cards.Count); }
public void DoubleDownTest() { ToolKit.Hand hand = new ToolKit.Hand(); Bots.StandartBot bot = new Bots.StandartBot(); hand.Bet = 666666; PlayerActions.DoubleDown(bot, hand, dealer, shoe); Assert.AreEqual(ToolKit.GamingState.Hit, hand.State); hand.Bet = 100; PlayerActions.DoubleDown(bot, hand, dealer, shoe); Assert.AreEqual(ToolKit.GamingState.Stand, hand.State); Assert.AreEqual(200, hand.Bet); Assert.AreEqual(10000 - 100, bot.Balance); }
public void TakeMoveHardHandTest() { StandartBot bot = new StandartBot(); ToolKit.Hand hand = new ToolKit.Hand(); ToolKit.Card dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Two); hand.Cards = NewSameCards(ToolKit.CardPoints.Two); hand.Cards.AddRange(NewSameCards(ToolKit.CardPoints.Two)); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Two); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Five)); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six); Assert.AreEqual(ToolKit.GamingState.Double, bot.TakeMove(hand, dealearCard)); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Two)); Assert.AreEqual(ToolKit.GamingState.Double, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ace); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); hand.Cards.RemoveAt(hand.Cards.Count - 2); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six)); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); hand = new ToolKit.Hand(); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ten)); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ten); Assert.AreEqual(ToolKit.GamingState.Surrender, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Seven); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Six); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); hand.Cards.Add(new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Two)); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); }
public void TakeMoveSplitTest() { StandartBot bot = new StandartBot(); bot.State = PlayerStructure.PlayerState.Stop; ToolKit.Card dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ace); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(bot.Hands[0], dealearCard)); bot.State = PlayerStructure.PlayerState.Playing; ToolKit.Hand hand = new ToolKit.Hand(); hand.Cards = NewSameCards(ToolKit.CardPoints.Five); Assert.AreEqual(ToolKit.GamingState.Double, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Four); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Five); Assert.AreEqual(ToolKit.GamingState.Split, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Nine); Assert.AreEqual(ToolKit.GamingState.Split, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ace); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Ten); Assert.AreEqual(ToolKit.GamingState.Stand, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Eight); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ten); Assert.AreEqual(ToolKit.GamingState.Split, bot.TakeMove(hand, dealearCard)); hand.Cards = NewSameCards(ToolKit.CardPoints.Seven); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Ace); Assert.AreEqual(ToolKit.GamingState.Hit, bot.TakeMove(hand, dealearCard)); dealearCard = new ToolKit.Card(ToolKit.Suits.Heart, ToolKit.CardPoints.Two); Assert.AreEqual(ToolKit.GamingState.Split, bot.TakeMove(hand, dealearCard)); }
public void SurrenderTest() { ToolKit.Hand hand = new ToolKit.Hand(); PlayerActions.Surrender(hand); Assert.AreEqual(ToolKit.GamingState.Surrender, hand.State); }