public void GameResult_ReturnsIntTwoWhenPlayerTwosChoiceIsGreaterThanPlayerOnesChoice_Two() { int playerOneChoice = 1; int playerTwoChoice = 2; int two = 2; int answer = RockPaperScissorsGame.GameResult(playerOneChoice, playerTwoChoice); Assert.AreEqual(two, answer); }
public void GameResult_ReturnsIntTwoIfPlayerTwosChoiceEqualsIntZeroAndPlayerOnesChoiceEqulsIntTwo_Two() { int playerOneChoice = 2; int playerTwoChoice = 0; int two = 2; int answer = RockPaperScissorsGame.GameResult(playerOneChoice, playerTwoChoice); Assert.AreEqual(two, answer); }
public void GameResult_ReturnIntOneIfPlayerOnesChoiceEqualsZeroAndPlayerTwosChoiceEqualsIntTwo_One() { int playerOneChoice = 0; int playerTwoChoice = 2; int one = 1; int answer = RockPaperScissorsGame.GameResult(playerOneChoice, playerTwoChoice); Assert.AreEqual(one, answer); }
public void GameResult_ReturnsStringDrawAsDefaultInt_Zero() { int playerOneChoice = 2; int playerTwoChoice = 2; int draw = 0; int answer = RockPaperScissorsGame.GameResult(playerOneChoice, playerTwoChoice); Assert.AreEqual(draw, answer); }
public ActionResult ComputerResults() { string PlayerOneSelection = Request.Form["player-one-selection-computer"]; List <RockPaperScissorsGame> allGames = RockPaperScissorsGame.GetAll(); RockPaperScissorsGame currentGame = allGames[0]; currentGame.SetPlayerOneChoice(PlayerOneSelection); currentGame.GameResult(); return(View(currentGame)); }
public ActionResult Results() { string PlayerTwoSelection = Request.Form["player-two-selection"]; List <RockPaperScissorsGame> allGames = RockPaperScissorsGame.GetAll(); RockPaperScissorsGame currentGame = allGames[0]; currentGame.SetPlayerTwoChoice(PlayerTwoSelection); currentGame.GameResult(); return(View(currentGame)); }
public void GameResult_SetScores_int() { //arrange RockPaperScissorsGame newGame = new RockPaperScissorsGame("Player 1", "Player 2"); //act newGame.SetPlayerOneChoice("Scissors"); newGame.SetPlayerTwoChoice("Paper"); newGame.GameResult(); string result = newGame.GetGameWinner(); //assert Assert.AreEqual(1, newGame.GetPlayerOneWins()); Assert.AreEqual(result, "Player 1 Wins!"); }