示例#1
0
        public async Task CanPatch_should_throw_exception_if_data_is_null()
        {
            SetupCanUpdate(true);

            var content = CreateContent(Status.Draft);
            var command = new PatchContent();

            await ValidationAssert.ThrowsAsync(() => GuardContent.CanPatch(command, content, contentWorkflow),
                                               new ValidationError("Data is required.", "Data"));
        }
示例#2
0
        public async Task CanPatch_should_not_throw_exception_if_data_is_not_null()
        {
            SetupCanUpdate(true);

            var content = CreateContent(Status.Draft);
            var command = new PatchContent {
                Data = new NamedContentData(), User = user
            };

            await GuardContent.CanPatch(command, content, contentWorkflow);
        }
示例#3
0
        public async Task CanPatch_should_throw_exception_if_workflow_blocks_it()
        {
            SetupCanUpdate(false);

            var content = CreateContent(Status.Draft);
            var command = new PatchContent {
                Data = new NamedContentData()
            };

            await Assert.ThrowsAsync <DomainException>(() => GuardContent.CanPatch(command, content, contentWorkflow));
        }