Esempio n. 1
0
        public void MsExecuteQueryTest()
        {
            var sqlhelper = new Initializer();
            Connector databaseConnector = new MsSqlConnector(GetConnectionString("cnniLiumDatabaseTest"));

            var dt = (System.Data.DataTable)sqlhelper.ExecuteQuery("SELECT TOP 2 * FROM Users ", databaseConnector);

            Assert.IsNotNull(dt);
            Assert.AreEqual(2, dt.Rows.Count);
        }
Esempio n. 2
0
        public void MySqlExecuteQueryTest()
        {
            var sqlhelper = new Initializer();

            Connector mySqlConnector = new MySqlConnector("Server=127.0.0.1;Database=dboptimove;Uid=astro;Pwd=1qazxc;Allow Zero Datetime=False;Convert Zero Datetime=True");
            var dt = (System.Data.DataTable)sqlhelper.ExecuteQuery("SELECT * FROM promotions;", mySqlConnector);

            Assert.IsNotNull(dt);
            //Assert.AreEqual(2, dt.Rows.Count);
        }