GetSingleResultSet() public static method

public static GetSingleResultSet ( ) : Net.Code.ADONet.Tests.Unit.Person[]
return Net.Code.ADONet.Tests.Unit.Person[]
Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        public void Single_WhenCalled_ReturnsSingleItem()
        {
            var command = PrepareCommand();

            var commandBuilder = new CommandBuilder(command, DbConfig.Default);

            command.SetResultSet(Person.GetSingleResultSet());

            var result = commandBuilder.Single <Person>();

            Person.VerifyResult(result);
        }
Example #5
0
        public void AsDatatable_WhenCalled_ReturnsResults()
        {
            var command = PrepareCommand();

            var commandBuilder = new CommandBuilder(command, DbConfig.Default);

            command.SetResultSet(Person.GetSingleResultSet());

            var result = commandBuilder.AsDataTable();

            Person.VerifyDataTable(result);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }