Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
 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));
 }