public async Task ApplyChanges(bool includeIdentity) { // Setup: // ... Generate the parameters for the row create const long rowId = 100; Common.TestDbColumnsWithTableMetadata data = new Common.TestDbColumnsWithTableMetadata(false, includeIdentity, 0, 0); ResultSet rs = await Common.GetResultSet(data.DbColumns, includeIdentity); // ... Setup a db reader for the result of an insert var newRowReader = Common.GetNewRowDataReader(data.DbColumns, includeIdentity); // If: I ask for the change to be applied RowCreate rc = new RowCreate(rowId, rs, data.TableMetadata); await rc.ApplyChanges(newRowReader); // Then: The result set should have an additional row in it Assert.Equal(2, rs.RowCount); }
public async Task ApplyChanges(bool includeIdentity) { // Setup: // ... Generate the parameters for the row create const long rowId = 100; DbColumn[] columns = Common.GetColumns(includeIdentity); ResultSet rs = await Common.GetResultSet(columns, includeIdentity); EditTableMetadata etm = Common.GetStandardMetadata(columns); // ... Setup a db reader for the result of an insert var newRowReader = Common.GetNewRowDataReader(columns, includeIdentity); // If: I ask for the change to be applied RowCreate rc = new RowCreate(rowId, rs, etm); await rc.ApplyChanges(newRowReader); // Then: The result set should have an additional row in it Assert.Equal(2, rs.RowCount); }