Exemplo n.º 1
0
        public void EndTurnTest()
        {
            GoodBot       firstGoodBot  = new GoodBot("FirstGoodBot", 1000);
            GoodBot       secondGoodBot = new GoodBot("SecondGoodBot", 1000);
            GoodBot       thirdGoodBot  = new GoodBot("ThirdGoodBot", 1000);
            GoodBot       fourthGoodBot = new GoodBot("FourthGoodBot", 1000);
            List <Player> players       = new List <Player> {
                firstGoodBot, secondGoodBot, thirdGoodBot, fourthGoodBot
            };
            Game game = new Game(players);

            firstGoodBot.TookCard(new Card(0, 1));
            firstGoodBot.TookCard(new Card(0, 10));
            firstGoodBot.MakeBet(100);
            secondGoodBot.TookCard(new Card(0, 1));
            secondGoodBot.MakeBet(100);
            game.Croupier.TookCard(new Card(0, 1));
            thirdGoodBot.TookCard(new Card(0, 2));
            thirdGoodBot.MakeBet(1000);
            fourthGoodBot.TookCard(new Card(0, 10));
            fourthGoodBot.TookCard(new Card(0, 10));
            fourthGoodBot.MakeBet(100);
            game.EndTurn();
            Assert.AreEqual(firstGoodBot.Balance, 1150);
            Assert.AreEqual(secondGoodBot.Balance, 1000);
            Assert.AreEqual(fourthGoodBot.Balance, 1100);
            Assert.AreEqual(game.Players.Count, 3);

            Assert.Pass();
        }
Exemplo n.º 2
0
        public void GetMoveTest()
        {
            GoodBot goodBot = new GoodBot("SomeName", 1000);

            goodBot.TookCard(new BlackJack.Card(0, 1));
            Assert.AreEqual(goodBot.GetMove(), BlackJack.PlayerMove.Double);
            goodBot.MakeBet(600);
            Assert.AreEqual(goodBot.GetMove(), BlackJack.PlayerMove.Hit);
            goodBot.TookCard(new BlackJack.Card(0, 6));
            Assert.AreEqual(goodBot.GetMove(), BlackJack.PlayerMove.Hit);
            goodBot.TookCard(new BlackJack.Card(0, 10));
            goodBot.TookCard(new BlackJack.Card(0, 10));
            Assert.AreEqual(goodBot.GetMove(), BlackJack.PlayerMove.Stand);

            Assert.Pass();
        }