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)); }
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")); }
public void SelectCell_WrongUsing3() { SQLite3Query sqlite = new SQLite3Query(); Assert.IsTrue(sqlite.TestConnection(connectionString, true, true)); sqlite.SelectCell <bool>("SELECT f1,f2 FROM WrongTable;"); }
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)); }