public void GetChoiceInput(Choice choice, Result expectedResult) { TestGame _game = new TestGame(); PaperPlayer player1 = new PaperPlayer("PaperPlayer"); Player player2; //Act switch (choice) { case Choice.Rock: player2 = new RockPplayer("rockplayer"); break; case Choice.Paper: player2 = new PaperPlayer("paperplayer"); break; default: player2 = new ScissorsPlayer("scissorsplayer"); break; } Result actual = _game.playRound(player1, player2); //Assert Assert.AreEqual(actual, expectedResult); }
public void ScissorsAlwaysTiesScissors() { IPlayer playerOne = new ScissorsPlayer(); IPlayer playerTwo = new ScissorsPlayer(); GameFlow game = new GameFlow(playerOne, playerTwo); Outcomes result = game.GetGameOutcome(); Assert.AreEqual(Outcomes.Draw, result); }
public void ScissorsAlwaysBeatsPaper() { IPlayer playerOne = new PaperPlayer(); IPlayer playerTwo = new ScissorsPlayer(); GameFlow game = new GameFlow(playerOne, playerTwo); Outcomes result = game.GetGameOutcome(); Assert.AreEqual(Outcomes.PlayerTwoWin, result); }