public void Setup() { var pageId = Guid.NewGuid(); _command = new UpdatePageDetails { SiteId = Guid.NewGuid(), Id = pageId, Name = "Name", Url = "url", Title = "Title", MetaDescription = "Meta Description", MetaKeywords = "Meta Keywords", PageLocalisations = new List <PageLocalisation> { new PageLocalisation { LanguageId = Guid.NewGuid(), Url = "url", Title = "Title", MetaDescription = "Meta Description", MetaKeywords = "Meta Keywords" } }, PagePermissions = new List <PagePermission> { new PagePermission { RoleId = Guid.NewGuid(), Type = PermissionType.View } } }; _validatorMock = new Mock <IValidator <UpdatePageDetails> >(); _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult()); _page = new Page(); _page.UpdateDetails(_command, _validatorMock.Object); _event = _page.Events.OfType <PageDetailsUpdated>().SingleOrDefault(); }
public void Handle(PageDetailsUpdated @event) { ClearPageCache(@event.SiteId, @event.AggregateRootId); }
public async Task Handle(PageDetailsUpdated @event) { await ClearPageCache(@event.SiteId, @event.AggregateRootId); }
public Task HandleAsync(PageDetailsUpdated @event) { return(ClearPageCache(@event.SiteId, @event.AggregateRootId)); }
private void Apply(PageDetailsUpdated @event) { UpdatePageDetails(@event); }