public async Task AsEnumerableAsyncWithSelector_WhenCalledAndAwaited_ReturnsResultSet() { var command = PrepareCommand(); var commandBuilder = new CommandBuilder(command, DbConfig.Default); command.SetResultSet(Person.GetSingleResultSet()); var result = (await commandBuilder.AsEnumerableAsync(d => (Person)Person.From(d))).ToList(); Person.VerifySingleResultSet(result); }
public void AsEnumerableGeneric_WhenCalled_ReturnsResults() { var command = PrepareCommand(); var commandBuilder = new CommandBuilder(command, DbConfig.Default); command.SetResultSet(Person.GetSingleResultSet()); var result = commandBuilder.AsEnumerable <Person>().ToList(); Person.VerifySingleResultSet(result); }
public void AsEnumerableWithSelector_WhenCalled_ReturnsResults() { var command = PrepareCommand(); var commandBuilder = new CommandBuilder(command, DbConfig.Default); command.SetResultSet(Person.GetSingleResultSet()); var result = commandBuilder.AsEnumerable(d => (Person)Person.From(d)).ToList(); Person.VerifySingleResultSet(result); }
public async Task AsEnumerableAsyncForType_WhenCalledAndAwaited_ReturnsResultSet() { var command = PrepareCommand(); var commandBuilder = new CommandBuilder(command, DbConfig.Default); command.SetResultSet(Person.GetSingleResultSet()); var result = new List <Person>(); await foreach (var p in commandBuilder.AsEnumerableAsync <Person>()) { result.Add(p); } Person.VerifySingleResultSet(result); }
public async Task AsEnumerableAsync_WhenCalledAndAwaited_ReturnsResultSet() { var command = PrepareCommand(); var commandBuilder = new CommandBuilder(command, DbConfig.Default); command.SetResultSet(Person.GetSingleResultSet()); var list = new List <dynamic>(); await foreach (var item in commandBuilder.AsEnumerableAsync()) { list.Add(item); } Person.VerifySingleResultSet(list); }