Пример #1
0
        public ActionResult CreateResult(string id, PlayerCreateViewModel modelView, FormCollection form)
        {
            TryUpdateModel(modelView, form.ToValueProvider());
            var hostPlayer      = _playerRop.SelectById(int.Parse(id));
            var opponent        = _playerRop.SelectById(int.Parse(form["Opponent"]));
            var blackBallPlayer = _playerRop.SelectById(int.Parse(form["BlackBallPlayer"]));

            var newResult = new Results(hostPlayer.Id, opponent.Id, DateTime.Today, int.Parse(form["MyList1"]), int.Parse(form["MyList2"]), blackBallPlayer.Id, int.Parse(form["blackBall"]));

            _resultsService.ResultsEvaluation(newResult);
            _resultsService.CalculatePoints(newResult);

            ViewBag.id = id;

            return(RedirectToAction("Index"));
        }
Пример #2
0
 public void Finding_the_OpponentStatus()
 {
     _service.ResultsEvaluation(_result);
     Assert.That(_result.OppnentStatus, Is.EqualTo("Loss"));
 }