public void PlayerOneScissors_PlayerOneWins_False() { RPS newGame = new RPS(); newGame.PlayerOneScissors("Rock"); int POS = newGame.GetPlayerOneScore(); Assert.AreEqual(POS, 0); }
public void PlayerOneScissors_PlayerOneWins_True() { RPS newGame = new RPS(); newGame.PlayerOneScissors("Paper"); int POS = newGame.GetPlayerOneScore(); Assert.AreEqual(POS, 1); }
public ActionResult GameResult() { string POChoice = Request.Form["PlayerOne"]; string PTChoice = Request.Form["PlayerTwo"]; RPS newGame = new RPS(); if (POChoice == "Rock") { newGame.PlayerOneRock(PTChoice); } else if (POChoice == "Paper") { newGame.PlayerOnePaper(PTChoice); } else if (POChoice == "Scissors") { newGame.PlayerOneScissors(PTChoice); } return(View("Index", newGame)); }
public ActionResult ComputerGameResult() { Random r = new Random(); int ComputerChoice = (r.Next(1, 3)); string PTChoice = Request.Form["PlayerSolo"]; RPS newGame = new RPS(); if (ComputerChoice == 1) { newGame.PlayerOneRock(PTChoice); } else if (ComputerChoice == 2) { newGame.PlayerOnePaper(PTChoice); } else if (ComputerChoice == 3) { newGame.PlayerOneScissors(PTChoice); } return(View("Index", newGame)); }