public static SqlCommand MockInsert <TSource, TTarget>(this DbTable <TTarget> dbTable, int rowsAffected, DbSet <TSource> source, Action <ColumnMapper, TSource, TTarget> columnMapper) where TSource : Model, new() where TTarget : Model, new() { dbTable.Verify(source, nameof(source)); var columnMappings = dbTable.Verify(columnMapper, nameof(columnMapper), source._); var result = dbTable.GetInsertCommand(dbTable.BuildInsertStatement(source, columnMappings)); dbTable.UpdateOrigin(source, rowsAffected); return(result); }