public void Setup() { var siteId = Guid.NewGuid(); _command = new UpdateSiteDetails { SiteId = Guid.NewGuid(), Url = "url", Title = "Title", MetaDescription = "Meta Description", MetaKeywords = "Meta Keywords", SiteLocalisations = new List <UpdateSiteDetails.SiteLocalisation> { new UpdateSiteDetails.SiteLocalisation { LanguageId = Guid.NewGuid(), Title = "Title", MetaDescription = "Meta Description", MetaKeywords = "Meta Keywords" } } }; _validatorMock = new Mock <IValidator <UpdateSiteDetails> >(); _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult()); _site = new Site(); _site.UpdateDetails(_command, _validatorMock.Object); _event = _site.Events.OfType <SiteDetailsUpdated>().SingleOrDefault(); }
private void SetSiteDetails(SiteDetailsUpdated @event) { Url = @event.Url; Title = @event.Title; MetaDescription = @event.MetaDescription; MetaKeywords = @event.MetaKeywords; HomePageId = @event.HomePageId; ThemeId = @event.ThemeId; AddLanguageSlug = @event.AddLanguageSlug; SetLocalisations(@event.SiteLocalisations); }
public async Task Handle(SiteDetailsUpdated @event) { await ClearCache(@event.AggregateRootId); }
private void Apply(SiteDetailsUpdated @event) { SetSiteDetails(@event); }
public void Handle(SiteDetailsUpdated @event) { ClearCache(@event.AggregateRootId, @event.Name); }