public void Setup() { _command = new CreateSite { Id = Guid.NewGuid(), Name = "Name" }; _validatorMock = new Mock <IValidator <CreateSite> >(); _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult()); _site = Site.CreateNew(_command, _validatorMock.Object); _event = _site.Events.OfType <SiteCreated>().SingleOrDefault(); }
public void Apply(SiteCreated createdEvent) { SiteName = createdEvent.SiteName; Location = createdEvent.Location; CountryName = createdEvent.CountryName; }
public void Apply(SiteCreated createdEvent) { Mapper.Map(createdEvent, this); }
private void Apply(SiteCreated @event) { Id = @event.AggregateRootId; Name = @event.Name; Status = @event.Status; }
public void Handle(SiteCreated e) { _sites.Save(e.Id, site => { }); }