Esempio n. 1
0
        public async Task CanUpdate_should_not_throw_exception_if_trigger_and_action_valid()
        {
            var command = CreateCommand(new UpdateRule
            {
                Trigger = new ContentChangedTrigger
                {
                    Schemas = ImmutableList <ContentChangedTriggerSchema> .Empty
                },
                Action = new WebhookAction
                {
                    Url = validUrl
                }
            });

            await GuardRule.CanUpdate(command, appProvider);
        }
Esempio n. 2
0
        public async Task CanUpdate_should_not_throw_exception_if_trigger_and_action_valid()
        {
            var command = new UpdateRule
            {
                Trigger = new ContentChangedTrigger
                {
                    Schemas = new List <ContentChangedTriggerSchema>()
                },
                Action = new WebhookAction
                {
                    Url = validUrl
                }
            };

            await GuardRule.CanUpdate(command, schemas);
        }
Esempio n. 3
0
        public async Task CanUpdate_should_throw_exception_if_action_and_trigger_are_null()
        {
            var command = new UpdateRule();

            await Assert.ThrowsAsync <ValidationException>(() => GuardRule.CanUpdate(command, appProvider));
        }
Esempio n. 4
0
        public void CanDelete_should_not_throw_exception()
        {
            var command = new DeleteRule();

            GuardRule.CanDelete(command);
        }