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); }
public void When(ChallengeCreated @event) { Created = true; Id = @event.Id; StartDate = @event.OccurredOn; Duration = TimeSpan.FromDays(30); DailyRepetitions = 100; Description = string.Empty; }