public async Task ShouldThrowExceptionIfNullResult()
            {
                IResultCursor result    = null;
                var           exception = await Record.ExceptionAsync(() => result.ForEachAsync(r => { }));

                exception.Should().BeOfType <ArgumentNullException>();
            }
示例#2
0
        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 => { }));
        }
示例#3
0
 public async Task PopulateRecords(IResultCursor cursor)
 {
     await cursor.ForEachAsync(record => Records.Add(record)).ConfigureAwait(false);
 }