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 Awake() { PaperPlayer = new PaperPlayer(); // set up inputs PaperPlayer.Movement.Move.performed += ctx => movementInput = ctx.ReadValue <Vector2>(); }
public void PaperAlwaysTiesPaper() { IPlayer playerOne = new PaperPlayer(); IPlayer playerTwo = new PaperPlayer(); GameFlow game = new GameFlow(playerOne, playerTwo); Outcomes result = game.GetGameOutcome(); Assert.AreEqual(Outcomes.Draw, result); }
public void PaperAlwaysBeatsRock() { IPlayer playerOne = new RockPlayer(); IPlayer playerTwo = new PaperPlayer(); GameFlow game = new GameFlow(playerOne, playerTwo); Outcomes result = game.GetGameOutcome(); Assert.AreEqual(Outcomes.PlayerTwoWin, result); }
public void PaperBeatsRock() { //Arrange IPlayer player1 = new PaperPlayer(); IPlayer player2 = new RockPlayer(); IGameResolver gameResolver = new GameResolver(); //Act int winner = gameResolver.GetWinner(player1, player2); //Assert Assert.AreEqual(1, winner); }