protected async Task <bool> ContainsAsync(FileSystemContentStoreInternal store, ContentHash contentHash) { var r = await store.ContainsAsync(Context, contentHash); Clock.Increment(); return(r); }
/// <inheritdoc /> public async Task <FileExistenceResult> CheckFileExistsAsync(Context context, ContentHash contentHash) { if (await Store.ContainsAsync(context, contentHash, null)) { return(new FileExistenceResult()); } else { return(new FileExistenceResult(FileExistenceResult.ResultCode.FileNotFound, $"{contentHash.ToShortString()} wasn't found in the cache")); } }
public Task ContainsFalse() { var context = new Context(Logger); return(TestStore(context, _clock, async store => { FileSystemContentStoreInternal cas = store; var contentHash = ContentHash.Random(); (await cas.ContainsAsync(context, contentHash)).Should().BeFalse(); })); }
protected async Task AssertDoesNotContain(FileSystemContentStoreInternal store, ContentHash contentHash) { var contains = await store.ContainsAsync(Context, contentHash); contains.Should().BeFalse($"Expected hash={contentHash.ToShortString()} to not be present but was"); }