public void MyBotShouldWinAgainstRandomBotTest() { // Arrange var me = new TestPlayer(); var randomPlayer = new TestPlayer(); var myBot = new MyBot(); var randomBot = new RandomBot(); // Act var winner = new GameEmulator().PlayMatch(me, myBot, randomPlayer, randomBot); // Assert Assert.AreSame(me, winner); }
public void DynamiteBeatsScissorsTest() { // Arrange var me = new MyBot(); var randomBot = new RandomBot(); var myMove = new BotMove { Player = me, Move = Moves.Dynamite }; var theirMove = new BotMove { Player = randomBot, Move = Moves.Scissors }; // Act var winner1 = new GameEmulator().DetermineWinner(myMove, theirMove); var winner2 = new GameEmulator().DetermineWinner(theirMove, myMove); // Assert Assert.AreSame(me, winner1); Assert.AreSame(me, winner2); }
public void PaperBeatsRockTest() { // Arrange var me = new MyBot(); var randomBot = new RandomBot(); var myMove = new BotMove { Player = me, Move = Moves.Paper }; var theirMove = new BotMove { Player = randomBot, Move = Moves.Rock }; // Act var winner1 = new GameEmulator().DetermineWinner(myMove, theirMove); var winner2 = new GameEmulator().DetermineWinner(theirMove, myMove); // Assert Assert.AreSame(me, winner1); Assert.AreSame(me, winner2); }
public void DynamiteTiesDynamiteTest() { // Arrange var me = new MyBot(); var randomBot = new RandomBot(); var myMove = new BotMove { Player = me, Move = Moves.Dynamite }; var theirMove = new BotMove { Player = randomBot, Move = Moves.Dynamite }; // Act var winner1 = new GameEmulator().DetermineWinner(myMove, theirMove); var winner2 = new GameEmulator().DetermineWinner(theirMove, myMove); // Assert Assert.IsNull(winner1); Assert.IsNull(winner2); }