public void FirstBotMakeBetTest(int balance, int result)
        {
            Game     game = new Game();
            FirstBot bot  = new FirstBot(game, balance);

            bot.MakeBet();
            Assert.AreEqual(bot.Balance, result);

            Assert.Pass();
        }
예제 #2
0
        public void PlayerFinishTest()
        {
            Game     game     = new Game();
            FirstBot bot      = new FirstBot(game, 1000);
            Croupier croupier = game.Croupier;

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Seven, CardSuit.Diamonds));
            bot.Finish();
            Assert.AreEqual(bot.Balance, 950);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Six, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Ten, CardSuit.Clubs));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1000);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            bot.Hand.Cards.Add(new Card(CardRank.Ten, CardSuit.Clubs));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Clubs));
            croupier.Hand.Cards.Add(new Card(CardRank.Ten, CardSuit.Spades));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1000);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            bot.Hand.Cards.Add(new Card(CardRank.Ten, CardSuit.Clubs));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Clubs));
            croupier.Hand.Cards.Add(new Card(CardRank.Seven, CardSuit.Spades));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1025);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Six, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Four, CardSuit.Clubs));
            croupier.Hand.Cards.Add(new Card(CardRank.Six, CardSuit.Spades));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1000);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Six, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Seven, CardSuit.Clubs));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1025);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Four, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Eight, CardSuit.Clubs));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1000);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Four, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Clubs));
            croupier.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Diamonds));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1025);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            bot.Hand.Cards.Add(new Card(CardRank.Four, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Seven, CardSuit.Clubs));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 1025);

            bot = new FirstBot(game, 1000);

            bot.MakeBet();
            bot.Hand.Cards.Add(new Card(CardRank.King, CardSuit.Clubs));
            bot.Hand.Cards.Add(new Card(CardRank.Five, CardSuit.Diamonds));
            croupier.Hand.Cards.Add(new Card(CardRank.Ace, CardSuit.Spades));
            croupier.Hand.Cards.Add(new Card(CardRank.Seven, CardSuit.Clubs));
            bot.Finish();
            croupier.Finish();
            Assert.AreEqual(bot.Balance, 950);

            Assert.Pass();
        }