public void AddBotsTest() { RouletteTable tableOne = new RouletteTable(); Player playerOne = new BotDAlembert("TestBotDAlembert", 27000); tableOne.AddPlayer(playerOne); Assert.AreEqual(tableOne.Players.Count, 1); Assert.AreEqual(tableOne.Players[0], playerOne); Assert.AreEqual(tableOne.Players[0].Deposit, 27000); playerOne.ShowInfo(); Player playerTwo = new BotLabouchere("TestBotLabouchere", 3000); tableOne.AddPlayer(playerTwo); Assert.AreEqual(tableOne.Players.Count, 2); Assert.AreEqual(tableOne.Players[1], playerTwo); Assert.AreEqual(tableOne.Players[1].Deposit, 3000); playerTwo.ShowInfo(); Player playerThree = new BotMartingale("TestBotMartingale", 7000); tableOne.AddPlayer(playerThree); Assert.AreEqual(tableOne.Players.Count, 3); Assert.AreEqual(tableOne.Players[2], playerThree); Assert.AreEqual(tableOne.Players[2].Deposit, 7000); playerThree.ShowInfo(); }
public void MakeBetBotMartingaleTest() { RouletteTable tableOne = new RouletteTable(); Player newBot = new BotMartingale("TestBotMartingaleOne", 0); List <Bet> newList = newBot.MakeBet(0); Assert.AreEqual(newList, null); Player playerTwo = new BotMartingale("TestBotMartingaleTwo", 15000); tableOne.AddPlayer(playerTwo); int bets = 0; newList = tableOne.Players[0].MakeBet(0); Assert.AreEqual(newList[0].Player, 0); int unit = playerTwo.Deposit / 40; Assert.AreEqual(newList[0].Money, unit); Assert.AreEqual(playerTwo.AmountOfBets, 0); while (tableOne.Observers.Count == 0) { tableOne.Spin(); if (tableOne.Observers.Count == 0) { bets++; } Assert.AreEqual(playerTwo.AmountOfBets, bets); Assert.AreEqual(playerTwo.Profit, playerTwo.Balance - 15000); } playerTwo.ShowInfo(); }