public async Task ShouldThrowExceptionIfNullResult() { IResultCursor result = null; var exception = await Record.ExceptionAsync(() => result.ForEachAsync(r => { })); exception.Should().BeOfType <ArgumentNullException>(); }
private static async Task AssertCannotAccessRecords(IResultCursor cursor) { await ThrowsResultConsumedException(async() => await cursor.FetchAsync()); await ThrowsResultConsumedException(async() => await cursor.PeekAsync()); ThrowsResultConsumedException(() => cursor.Current); await ThrowsResultConsumedException(async() => await cursor.SingleAsync()); await ThrowsResultConsumedException(async() => await cursor.ToListAsync()); await ThrowsResultConsumedException(async() => await cursor.ForEachAsync(r => { })); }
public async Task PopulateRecords(IResultCursor cursor) { await cursor.ForEachAsync(record => Records.Add(record)).ConfigureAwait(false); }