public DataSetComparer(string outputFolder, TextWriter logWriter, DataTableProducer qa, DataTableProducer qb) { if (qa == null) { throw new ArgumentNullException("queryA"); } if (qb == null) { throw new ArgumentNullException("queryB"); } if (qa.Options == null) { throw new ArgumentNullException("queryA.Options"); } if (qb.Options == null) { throw new ArgumentNullException("queryB.Options"); } this.outputFolder = outputFolder; this.logWriter = logWriter; this.queryA = qa; this.queryB = qb; if (qa.Options.TableNickName == qb.Options.TableNickName) { throw new ArgumentException("output file names cannot be the same for both queries."); } }
public CompareBuilder Compare(InputTypes inputType, string query, string connectionString = "", string tableNickName = "") { a = DataTableProducer.Factory.Create(new CompareBuilderOptions { InputType = inputType, Query = query, ConnectionString = connectionString, TableNickName = tableNickName }); return(this); }
public CompareBuilder To(DataTable dt, string resultNick) { if (dt == null) { throw new ArgumentNullException("dt"); } b = DataTableProducer.Factory.Create(new CompareBuilderOptions { InputType = InputTypes.DataTable, Query = resultNick, DataTable = dt, TableNickName = resultNick, ConnectionString = "" }); return(this); }
public static DataTableProducer Create(CompareBuilderOptions options) { switch (options.InputType) { case InputTypes.Query: return(DataTableProducer.FromQuery(options)); case InputTypes.CsvFile: return(DataTableProducer.FromCsvFile(options)); case InputTypes.DataTable: return(DataTableProducer.FromDataTable(options)); default: throw new ArgumentException("Unimplemented argument for InputType"); } }