public async Task CanCreate_should_throw_exception_if_action_null() { var command = CreateCommand(new CreateRule { Trigger = new ContentChangedTrigger { Schemas = ImmutableList <ContentChangedTriggerSchema> .Empty }, Action = null }); await Assert.ThrowsAsync <ValidationException>(() => GuardRule.CanCreate(command, appProvider)); }
public async Task CanCreate_should_throw_exception_if_trigger_null() { var command = CreateCommand(new CreateRule { Trigger = null, Action = new WebhookAction { Url = validUrl } }); await Assert.ThrowsAsync <ValidationException>(() => GuardRule.CanCreate(command, appProvider)); }
public async Task CanCreate_should_throw_exception_if_action_null() { var command = new CreateRule { Trigger = new ContentChangedTrigger { Schemas = new List <ContentChangedTriggerSchema>() }, Action = null }; await Assert.ThrowsAsync <ValidationException>(() => GuardRule.CanCreate(command, schemas)); }
public async Task CanCreate_should_not_throw_exception_if_trigger_and_action_valid() { var command = CreateCommand(new CreateRule { Trigger = new ContentChangedTrigger { Schemas = ImmutableList <ContentChangedTriggerSchema> .Empty }, Action = new WebhookAction { Url = validUrl } }); await GuardRule.CanCreate(command, appProvider); }
public async Task CanCreate_should_not_throw_exception_if_trigger_and_action_valid() { var command = new CreateRule { Trigger = new ContentChangedTrigger { Schemas = new List <ContentChangedTriggerSchema>() }, Action = new WebhookAction { Url = validUrl } }; await GuardRule.CanCreate(command, schemas); }