Esempio n. 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"));
        }
Esempio n. 2
0
        public void TestReturned_Objects()
        {
            int expetedPoints = _service.CalculatePoints(_result).Count;

            Assert.That(expetedPoints, Is.EqualTo(2));
        }