Esempio n. 1
0
        public static void UseSingleChallenge(IEventStore eventStore)
        {
            if (ChallengeViewModels.Any())
            {
                return;
            }
            var id          = ChallengeId;
            var description = "Hundre pushups hver dag";
            var createEvent = new ChallengeCreated(id, 100, description, DateTime.Now.AddDays(-5));
            var viewModel   = new ChallengeViewModel
            {
                Id               = id.Guid,
                Desciption       = description,
                DailyRepetitions = 100,
                StartDate        = DateTime.Now.AddDays(-5),
                ActiveMonday     = true,
                ActiveTuesday    = true,
                ActiveWednesday  = true,
                ActiveThursday   = true,
                ActiveFriday     = true,
                ActiveSaturday   = true,
                ActiveSunday     = true,
                Duration         = TimeSpan.FromDays(30),
                TotalRepetitions = 460
            };

            eventStore.Add(id, new List <IEvent> {
                createEvent
            });
            ChallengeViewModels.Add(viewModel);
        }
Esempio n. 2
0
 public void When(ChallengeCreated @event)
 {
     Created          = true;
     Id               = @event.Id;
     StartDate        = @event.OccurredOn;
     Duration         = TimeSpan.FromDays(30);
     DailyRepetitions = 100;
     Description      = string.Empty;
 }