Beispiel #1
0
 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();
 }
Beispiel #2
0
 public void Apply(SiteCreated createdEvent)
 {
     SiteName    = createdEvent.SiteName;
     Location    = createdEvent.Location;
     CountryName = createdEvent.CountryName;
 }
Beispiel #3
0
 public void Apply(SiteCreated createdEvent)
 {
     Mapper.Map(createdEvent, this);
 }
Beispiel #4
0
 private void Apply(SiteCreated @event)
 {
     Id     = @event.AggregateRootId;
     Name   = @event.Name;
     Status = @event.Status;
 }
 public void Handle(SiteCreated e)
 {
     _sites.Save(e.Id, site => { });
 }