Ejemplo n.º 1
0
 public ParseResult(int teamScore, int awayScore, ResultSeriesReadModel.Serie[] series)
 {
     if (series == null) throw new ArgumentNullException("series");
     Series = series;
     OpponentScore = awayScore;
     TeamScore = teamScore;
 }
Ejemplo n.º 2
0
 public RegisterSerie(ResultSeriesReadModel.Serie serie, List<SelectListItem> players)
 {
     if (serie == null) throw new ArgumentNullException("serie");
     if (players == null) throw new ArgumentNullException("players");
     Serie = serie;
     Players = players;
 }
Ejemplo n.º 3
0
 public ResultViewModel(ResultHeaderReadModel headerReadModel, ResultSeriesReadModel resultReadModel)
 {
     if (headerReadModel == null) throw new ArgumentNullException("headerReadModel");
     if (resultReadModel == null) throw new ArgumentNullException("resultReadModel");
     HeaderReadModel = headerReadModel;
     ResultReadModel = resultReadModel;
 }
        public ActionResult RegisterSerie(
            string aggregateId, int bitsMatchId, ResultSeriesReadModel.Serie serie)
        {
            var matchResult = EventStoreSession.Load<MatchResult>(aggregateId);
            if (matchResult == null) throw new HttpException(404, "Match result not found");
            var tables = new List<MatchTable>();
            for (var i = 0; i < 4; i++)
            {
                var game1 = new MatchGame(
                    serie.Tables[i].Game1.Player,
                    serie.Tables[i].Game1.Pins,
                    serie.Tables[i].Game1.Strikes,
                    serie.Tables[i].Game1.Spares);
                var game2 = new MatchGame(
                    serie.Tables[i].Game2.Player,
                    serie.Tables[i].Game2.Pins,
                    serie.Tables[i].Game2.Strikes,
                    serie.Tables[i].Game2.Spares);
                tables.Add(new MatchTable(game1, game2, serie.Tables[i].Score));
            }

            matchResult.RegisterSerie(new MatchSerie(tables));
            return RedirectToAction(
                "Details",
                "MatchResult",
                new
                {
                    id = bitsMatchId
                });
        }
Ejemplo n.º 5
0
 private static void VerifyTable(ResultSeriesReadModel.Table table, Tuple<int, string, int, string, int> expected)
 {
     Assert.Equal(expected.Item1, table.Score);
     Assert.NotNull(table.Game1);
     Assert.NotNull(table.Game2);
     Assert.Equal(expected.Item2, table.Game1.Player);
     Assert.Equal(expected.Item3, table.Game1.Pins);
     Assert.Equal(expected.Item4, table.Game2.Player);
     Assert.Equal(expected.Item5, table.Game2.Pins);
 }