Example #1
0
        private GameDay getGameDay()
        {
            GameDayModel gdModel = new GameDayModel();
            GameDay      gd      = new GameDay(gdModel);

            return(gd);
        }
Example #2
0
        public void TestPutInGameDay_WhenGiven_ThenUpdated()
        {
            Guid         expected = Guid.NewGuid();
            GameDayModel gdModel  = new GameDayModel()
            {
                Id = expected
            };
            GameDay gd = new GameDay(gdModel);

            this.dut.PutInGameDay(gd);

            Assert.True(expected.Equals(this.model.GameDay));
        }
Example #3
0
        public StreakViewModel StreakFor(
            DateTime startDate,
            DateTime endDate)
        {
            var result = new StreakViewModel
            {
                StartDate      = startDate,
                EndDate        = endDate,
                OptionSettings = _picker.GetOptions().OptionStrings()
            };
            TimeSpan range = endDate - startDate;

            for (int i = 0; i < range.TotalDays + 1; i++)
            {
                var gameDate  = startDate.AddDays(i);
                var selection = _picker.Choose(
                    gameDate: gameDate,
                    numberRequired: NumberOfBattersRequired());
                //selection.Dump();
                if (selection.Selections.Count > 0)
                {
                    foreach (var batter in selection.Selections)
                    {
                        if (batter == null)
                        {
                            continue;
                        }
                        batter.Result = _resultChecker.Result(
                            batter.Batter,
                            gameDate);
                    }
                }
                var gameDay = new GameDayModel
                {
                    GameDate   = gameDate,
                    Selections = selection.Selections
                };
                result.GameDays.Add(gameDay);
            }
            return(result);
        }
Example #4
0
 /// <summary>
 /// Creates an new empty GameDay.
 /// </summary>
 /// <param name="givenModel">The GameDayModel that holds data about this GameDay.</param>
 public GameDay(GameDayModel givenModel)
 {
     this.model = givenModel;
     this.games = new List <Game>();
 }