public void Test_EraseBotType() { IPokerDatabase database = new PokerDatabase(); int numberOfBots = 5; for (int i = 0; i < numberOfBots; i++) { IPlayer currentPlayer = new Player(i.ToString()); currentPlayer.Type = 1000; database.AddBot(currentPlayer); } IBotEraser eraser = new BotEraser(); eraser.EraseBotType(database); bool isTypeErased = true; for (int i = 0; i < numberOfBots; i++) { if (database.TakeBotByIndex(i).Type != PokerGameConstants.PlayerDefaultType) { isTypeErased = false; break; } } Assert.IsTrue(isTypeErased, "Bots type is not erased."); }
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."); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IBotEraser currentEraser = new BotEraser(); IActionManager actionManager = new ActionManager(); ICombinationDatabase combinationDatabase = new CombinationsDatabase(actionManager); Application.Run(new GameTable(actionManager, currentEraser, combinationDatabase)); }
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."); }