public async Task CanDelete_should_throw_exception_if_singleton()
        {
            var content = CreateContent(Status.Published);

            var command = CreateCommand(new DeleteContent());

            await Assert.ThrowsAsync <DomainException>(() => GuardContent.CanDelete(command, content, contentRepository, singleton));
        }
        public async Task CanDelete_should_not_throw_exception()
        {
            var content = CreateContent(Status.Published);

            var command = CreateCommand(new DeleteContent());

            await GuardContent.CanDelete(command, content, contentRepository, schema);
        }
Beispiel #3
0
        public async Task CanDelete_should_throw_exception_if_referenced()
        {
            var schema = CreateSchema(true);

            var content = CreateContent(Status.Published);
            var command = new DeleteContent();

            A.CallTo(() => contentRepository.HasReferrersAsync(appId.Id, content.Id, SearchScope.All))
            .Returns(true);

            await Assert.ThrowsAsync <DomainException>(() => GuardContent.CanDelete(command, content, contentRepository, schema));
        }