示例#1
0
        public async Task CanDelete_should_not_throw_exception()
        {
            var command = new DeleteAsset {
                AppId = appId
            };

            await GuardAsset.CanDelete(command, Asset(), contentRepository);
        }
示例#2
0
        public void CanDelete_should_not_throw_exception()
        {
            var command = new DeleteAsset {
                AppId = appId
            };

            GuardAsset.CanDelete(command);
        }
示例#3
0
        public async Task CanDelete_should_throw_exception_if_referenced()
        {
            var asset = Asset();

            var command = new DeleteAsset {
                AppId = appId, CheckReferrers = true
            };

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

            await Assert.ThrowsAsync <DomainException>(() => GuardAsset.CanDelete(command, asset, contentRepository));
        }