Пример #1
0
        protected override async Task <U4Pair> RunProxiedDbDataAdapterAsync(List <TestTable> randomDataSource, FakeProxiedDbDataAdapter adapter)
        {
            using (DbCommandBuilder <FakeDbCommand> cmdBuilder = await adapter.CreateCommandBuilderAsync().ConfigureAwait(false))
            {
                DataSet dataSet = new DataSet();

                // `.Fill` returns the number of rows in the first table, not any subsequent tables. Yes, that's silly.
                Int32 rowsInFirstTable = await adapter.FillAsync(dataSet);

                rowsInFirstTable.ShouldBe(40);

                //
                Dictionary <String, Int32> rowsModified = DataTableMethods.MutateDataSet(dataSet);

                //
                adapter.UpdateCommand = cmdBuilder.GetUpdateCommand();
                adapter.UpdateCommand.NonQueryResultRowCountValue = (cmd) => DataTableMethods.GetUpdateStatementNonQueryResultRowCountValue(expectedTableName: "TODO", adapter, dataSet, cmd, rowsModified);

                Int32 updatedRows = await adapter.Update4Async(dataSet, srcTable : "RandomDataTable_2");

//              updatedRows.ShouldBe( rowsModified );

                return(dataSet, rowsModified, updatedRows);
            }
        }