public void MakeBetBotDAlembertTest() { RouletteTable tableOne = new RouletteTable(); Player newBot = new BotDAlembert("TestBotDAlembertOne", 0); List <Bet> newList = newBot.MakeBet(0); Assert.AreEqual(newList, null); Player playerTwo = new BotDAlembert("TestBotDAlembertTwo", 10000); 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 - 10000); } playerTwo.ShowInfo(); }
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 SpinBotMartingaleTest() { RouletteTable tableOne = new RouletteTable(); Player playerOne = new BotDAlembert("TestBotMartingaleOne", 0); tableOne.AddPlayer(playerOne); tableOne.Spin(); Assert.AreEqual(tableOne.Observers[0], playerOne); Player playerTwo = new BotMartingale("TestBotMartingaleTwo", 3000); tableOne.AddPlayer(playerTwo); tableOne.Spin(); tableOne.ShowInfoAboutPlayers(); Assert.AreEqual(tableOne.Players[0].Name, "TestBotMartingaleTwo"); Assert.AreEqual(tableOne.Players[0].AmountOfBets, 1); int oldBalance = tableOne.Players[0].Balance; tableOne.Spin(); tableOne.ShowInfoAboutPlayers(); Assert.AreEqual(tableOne.Players[0].AmountOfBets, 2); Assert.AreNotEqual(tableOne.Players[0].Balance, oldBalance); }