private void verifyLogTableData(KeyValuePair <string, List <string> > table) { var rows = TestDB.runSQLQuery(config, String.Format("SELECT COUNT(*) AS COUNT FROM ecpr_{0}_logs", table.Key)); var count = rows.First(); Debug.Assert((int)count.Value == nRows); }
public void countTables() { foreach (var table in TestQuery.TEST_QUERY) { var rows = TestDB.runSQLQuery(config, String.Format("SELECT COUNT(*) AS COUNT FROM {0}", table.Key)); var count = rows.First(); Console.WriteLine("Table: {0} - Count: {1}", table.Key, count.Value); } }
private void insertTestData(KeyValuePair <string, List <string> > table) { string insertQueryTpl = "INSERT INTO {0} ({1}) VALUES({2})"; string[] columns = table.Value.Select(x => "@" + x).ToArray(); string insertQuery = String.Format(insertQueryTpl, table.Key, String.Join(",", table.Value.ToArray()), String.Join(",", columns) ); for (int i = 1; i <= nRows; i++) { Dictionary <string, object> data = new Dictionary <string, object>(); foreach (string column in columns) { data.Add(column, i); } TestDB.runSQLNoneQuery(config, insertQuery, data); } }
private void cleanupMainTable(string tableName) { TestDB.runSQLNoneQuery(config, String.Format("DELETE FROM {0}", tableName)); TestDB.runSQLNoneQuery(config, String.Format("DELETE FROM ecpr_{0}_logs", tableName)); }