Esempio n. 1
0
        public void Tie_User_And_Computer_Paper()
        {
            ChoiceModel     choiceUser     = _judgeService.CheckChoicePlayers("2");
            ChoiceModel     choiceComputer = _judgeService.CheckChoicePlayers("2");
            ResultGameModel result         = _judgeService.JudgeDefinesWinner(choiceUser.ChoiceEnum.ToString(), choiceComputer.ChoiceEnum.ToString());

            Assert.AreEqual(result.ResultadoEnum, ResultadoEnum.Tie);
        }
Esempio n. 2
0
        public void User_Loses_With_Paper_Against_Scissor()
        {
            ChoiceModel     choiceUser     = _judgeService.CheckChoicePlayers("2");
            ChoiceModel     choiceComputer = _judgeService.CheckChoicePlayers("3");
            ResultGameModel result         = _judgeService.JudgeDefinesWinner(choiceUser.ChoiceEnum.ToString(), choiceComputer.ChoiceEnum.ToString());

            Assert.AreEqual(result.ResultadoEnum, ResultadoEnum.ComputerWins);
        }
Esempio n. 3
0
        public ActionResult EndGame(EndGameModel model)
        {
            //UPDATE DB
            var pongRepo        = new PongRepo();
            var resultGameModel = new ResultGameModel();

            if (model.GameId != -1)
            {
                pongRepo.UpdateDB(model);
                var finishedModel = pongRepo.GetLastGame();
                resultGameModel.FinishedGame = finishedModel;
            }
            var statisticsModel = pongRepo.GetStatistics();

            resultGameModel.StatisticsGame = statisticsModel;
            return(PartialView("EndGame", resultGameModel));
        }