Esempio n. 1
0
        public async Task CanCreate_should_throw_exception_if_trigger_null()
        {
            var command = new CreateRule
            {
                Trigger = null !,
                Action  = new TestAction
                {
                    Url = validUrl
                },
                AppId = appId
            };

            await ValidationAssert.ThrowsAsync(() => GuardRule.CanCreate(command, appProvider),
                                               new ValidationError("Trigger is required.", "Trigger"));
        }
Esempio n. 2
0
        public async Task CanCreate_should_not_throw_exception_if_trigger_and_action_valid()
        {
            var command = new CreateRule
            {
                Trigger = new ContentChangedTriggerV2
                {
                    Schemas = ReadOnlyCollection.Empty <ContentChangedTriggerSchemaV2>()
                },
                Action = new TestAction
                {
                    Url = validUrl
                },
                AppId = appId
            };

            await GuardRule.CanCreate(command, appProvider);
        }
Esempio n. 3
0
        public async Task CanUpdate_should_not_throw_exception_if_trigger_action__and_name_are_valid()
        {
            var command = new UpdateRule
            {
                Trigger = new ContentChangedTriggerV2
                {
                    Schemas = ReadOnlyCollection.Empty <ContentChangedTriggerSchemaV2>()
                },
                Action = new TestAction
                {
                    Url = validUrl
                },
                Name = "NewName"
            };

            await GuardRule.CanUpdate(command, Rule(), appProvider);
        }
Esempio n. 4
0
        public async Task CanUpdate_should_not_throw_exception_if_all_properties_are_null()
        {
            var command = new UpdateRule();

            await GuardRule.CanUpdate(command, Rule(), appProvider);
        }
Esempio n. 5
0
        public void CanDelete_should_not_throw_exception()
        {
            var command = new DeleteRule();

            GuardRule.CanDelete(command);
        }
Esempio n. 6
0
        public void CanEnable_should_not_throw_exception()
        {
            var command = new EnableRule();

            GuardRule.CanEnable(command);
        }