예제 #1
0
        public void SelectCell_DefaultReturnValues()
        {
            SQLite3Query sqlite = new SQLite3Query();

            Assert.IsTrue(sqlite.TestConnection(connectionString, true, false));
            Assert.AreEqual(true, Convert.ToBoolean(sqlite.SelectCell <Int64>("SELECT f2 FROM TestTable;", 0)));
            Assert.AreEqual(true, sqlite.SelectCell <bool>("SELECT f999 FROM TestTable;", true));
        }
예제 #2
0
        public void SelectCell_DataTypes1()
        {
            SQLite3Query sqlite = new SQLite3Query();

            Assert.IsTrue(sqlite.TestConnection(connectionString, true, true));
            Assert.AreEqual(DBNull.Value, sqlite.SelectCell <DBNull>("SELECT f4 FROM TestTable;"));
            Assert.AreEqual(DateTime.Now.ToString("dd.MM.yyyy"), Convert.ToDateTime(sqlite.SelectCell <string>("SELECT date('now');")).ToString("dd.MM.yyyy"));
        }
예제 #3
0
        public void SelectCell_WrongUsing3()
        {
            SQLite3Query sqlite = new SQLite3Query();

            Assert.IsTrue(sqlite.TestConnection(connectionString, true, true));
            sqlite.SelectCell <bool>("SELECT f1,f2 FROM WrongTable;");
        }
예제 #4
0
        public void SelectCellTest <T>(T pExpectedValue, string sqlSelectStatement)
        {
            SQLite3Query sqlite = new SQLite3Query();

            Assert.IsTrue(sqlite.TestConnection(connectionString, true, false));
            Assert.AreEqual(pExpectedValue, sqlite.SelectCell <T>(sqlSelectStatement));
        }