private static bool Matchs(WebhookSchema webhookSchema, SchemaEvent @event) { return ((@event.SchemaId.Id == webhookSchema.SchemaId) && (webhookSchema.SendCreate && @event is ContentCreated || webhookSchema.SendUpdate && @event is ContentUpdated || webhookSchema.SendDelete && @event is ContentDeleted || webhookSchema.SendPublish && @event is ContentStatusChanged statusChanged && statusChanged.Status == Status.Published)); }
private static bool Matchs(WebhookSchema webhookSchema, SchemaEvent @event) { return ((@event.SchemaId.Id == webhookSchema.SchemaId) && (@event is ContentCreated && webhookSchema.SendCreate || @event is ContentUpdated && webhookSchema.SendUpdate || @event is ContentDeleted && webhookSchema.SendDelete || @event is ContentPublished && webhookSchema.SendPublish || @event is ContentUnpublished && webhookSchema.SendUnpublish)); }
private IWebhookEntity CreateWebhook(int offset) { var webhook = A.Dummy <IWebhookEntity>(); var schema = new WebhookSchema { SchemaId = schemaId.Id, SendCreate = true, SendUpdate = true }; A.CallTo(() => webhook.Id).Returns(Guid.NewGuid()); A.CallTo(() => webhook.Url).Returns(new Uri($"http://domain{offset}.com")); A.CallTo(() => webhook.Schemas).Returns(new[] { schema }); A.CallTo(() => webhook.SharedSecret).Returns($"secret{offset}"); return(webhook); }