public async Task CanDelete_should_not_throw_exception() { var command = new DeleteAsset { AppId = appId }; await GuardAsset.CanDelete(command, Asset(), contentRepository); }
public void CanDelete_should_not_throw_exception() { var command = new DeleteAsset { AppId = appId }; GuardAsset.CanDelete(command); }
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)); }