예제 #1
0
        protected override U4Pair RunProxiedDbDataAdapter(List <TestTable> randomDataSource, FakeProxiedDbDataAdapter adapter)
        {
            using (FakeDbCommandBuilder cmdBuilder = new FakeDbCommandBuilder(adapter))
            {
                DataSet dataSet = new DataSet();

                // `.Fill` returns the number of rows in the first table, not any subsequent tables. Yes, that's silly.
                Int32 rowsInFirstTable = adapter.Fill(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 = adapter.Update4(dataSet, srcTable: "RandomDataTable_2");
//              updatedRows.ShouldBe( rowsModified );

                return(dataSet, rowsModified, updatedRows);
            }
        }