Пример #1
0
        public void SetWinState_Player1Wins_True()
        {
            JanKenPonGame newPon = new JanKenPonGame();

            newPon.SetPlayer1JKP("Rock");
            newPon.SetPlayer2JKP("Scissors");
            string player1Pon = newPon.GetPlayer1JKP();
            string player2Pon = newPon.GetPlayer2JKP();

            newPon.SetWinState(player1Pon, player2Pon);
            bool winnerDecision = newPon.GetWinState();

            Assert.AreEqual(true, winnerDecision);
        }
Пример #2
0
        public ActionResult Winner()
        {
            JanKenPonGame newGame = new JanKenPonGame();

            newGame.SetPlayer1JKP(Request.Form["player1"]);
            newGame.SetPlayer2JKP(Request.Form["player2"]);
            string player1choice = newGame.GetPlayer1JKP();
            string player2choice = newGame.GetPlayer2JKP();

            newGame.SetWinState(player1choice, player2choice);
            bool winner = newGame.GetWinState();

            if (winner == true)
            {
                return(View("TheFists", "Player1 Wins!"));
            }
            else
            {
                return(View("TheFists", "Player2 Wins!"));
            }
        }