public void Test_DisableBots()
        {
            IPokerDatabase database = new PokerDatabase();
            int numberOfBots = 5;
            for (int i = 0; i < numberOfBots; i++)
            {
                IPlayer currentPlayer = new Player(i.ToString());
                currentPlayer.CanPlay = true;
                database.AddBot(currentPlayer);
            }

            IBotEraser eraser = new BotEraser();
            eraser.DisableBots(database);

            bool areAllDisabled = true;
            for (int i = 0; i < numberOfBots; i++)
            {
                if (database.TakeBotByIndex(i).CanPlay)
                {
                    areAllDisabled = false;
                    break;
                }
            }

            Assert.IsTrue(areAllDisabled, "Bots are not disabled.");
        }
        public void Test_EraseBotPower()
        {
            IPokerDatabase database = new PokerDatabase();
            int numberOfBots = 5;
            for (int i = 0; i < numberOfBots; i++)
            {
                IPlayer currentPlayer = new Player(i.ToString());
                currentPlayer.Power = 1000;
                database.AddBot(currentPlayer);
            }

            IBotEraser eraser = new BotEraser();
            eraser.EraseBotPower(database);

            bool isPowerErased = true;
            for (int i = 0; i < numberOfBots; i++)
            {
                if (database.TakeBotByIndex(i).Power != PokerGameConstants.PlayerDefaultPower)
                {
                    isPowerErased = false;
                    break;
                }
            }

            Assert.IsTrue(isPowerErased, "Bots power is not erased.");
        }
 public void Test_TakeBotByIndex_IndexGreaterThanTheBotCollection()
 {
     IPokerDatabase database = new PokerDatabase();
     IPlayer testBot = new Player("Test Bot");
     database.AddBot(testBot);
     IPlayer currentBot = database.TakeBotByIndex(1);
 }
 public void Test_TakeBotByIndex_NegativeIndex()
 {
     IPokerDatabase database = new PokerDatabase();
     IPlayer testBot = new Player("Test Bot");
     database.AddBot(testBot);
     IPlayer currentBot = database.TakeBotByIndex(-1);
 }
        public void Test_TakeBotByIndex()
        {
            IPokerDatabase database = new PokerDatabase();
            IPlayer testBot = new Player("Test Bot");
            database.AddBot(testBot);

            IPlayer currentBot = database.TakeBotByIndex(0);
            Assert.AreEqual(currentBot, testBot, "The take bot by index method does not work correctly.");
        }
        public void Test_UnFoldBots()
        {
            IPokerDatabase database = new PokerDatabase();
            int numberOfBots = 5;
            for (int i = 0; i < numberOfBots; i++)
            {
                IPlayer currentPlayer = new Player(i.ToString());
                currentPlayer.Folded = true;
                database.AddBot(currentPlayer);
            }

            IBotEraser eraser = new BotEraser();
            eraser.UnFoldBots(database);

            bool areAllFolded = true;
            for (int i = 0; i < numberOfBots; i++)
            {
                if (database.TakeBotByIndex(i).Folded != PokerGameConstants.PlayerDefaultFolded)
                {
                    areAllFolded = false;
                    break;
                }
            }

            Assert.IsTrue(areAllFolded, "Bot have folded.");
        }
        public void Test_EnableBotChips()
        {
            IPokerDatabase database = new PokerDatabase();
            int numberOfBots = 5;
            for (int i = 0; i < numberOfBots; i++)
            {
                IPlayer currentPlayer = new Player(i.ToString());
                currentPlayer.OutOfChips = true;
                database.AddBot(currentPlayer);
            }

            IBotEraser eraser = new BotEraser();
            eraser.EnableBotChips(database);

            bool areChipsEnabled = true;
            for (int i = 0; i < numberOfBots; i++)
            {
                if (database.TakeBotByIndex(i).OutOfChips != PokerGameConstants.PlayerDefaultOutOfChips)
                {
                    areChipsEnabled = false;
                    break;
                }
            }

            Assert.IsTrue(areChipsEnabled, "Bot chips are not enabled.");
        }