public void TestBoolean() { var sqlite3Platform = new SQLitePlatformTest(); string tmpFile = TestPath.CreateTemporaryDatabase(); var db = new DbAcs(sqlite3Platform, tmpFile); db.buildTable(); for (int i = 0; i < 10; i++) { db.Insert(new VO { Flag = (i % 3 == 0), Text = String.Format("VO{0}", i) }); } // count vo which flag is true Assert.AreEqual(4, db.CountWithFlag(true)); Assert.AreEqual(6, db.CountWithFlag(false)); Debug.WriteLine("VO with true flag:"); foreach (VO vo in db.Query <VO>("SELECT * FROM VO Where Flag = ?", true)) { Debug.WriteLine(vo.ToString()); } Debug.WriteLine("VO with false flag:"); foreach (VO vo in db.Query <VO>("SELECT * FROM VO Where Flag = ?", false)) { Debug.WriteLine(vo.ToString()); } }
public void TestBoolean() { var sqlite3Platform = new SQLitePlatformTest(); string tmpFile = TestPath.CreateTemporaryDatabase(); var db = new DbAcs(sqlite3Platform, tmpFile); db.buildTable(); for (int i = 0; i < 10; i++) { db.Insert(new VO { Flag = (i%3 == 0), Text = String.Format("VO{0}", i) }); } // count vo which flag is true Assert.AreEqual(4, db.CountWithFlag(true)); Assert.AreEqual(6, db.CountWithFlag(false)); Debug.WriteLine("VO with true flag:"); foreach (VO vo in db.Query<VO>("SELECT * FROM VO Where Flag = ?", true)) { Debug.WriteLine(vo.ToString()); } Debug.WriteLine("VO with false flag:"); foreach (VO vo in db.Query<VO>("SELECT * FROM VO Where Flag = ?", false)) { Debug.WriteLine(vo.ToString()); } }
public void TestFixtureSetUp() { _sqlite3Platform = new SQLitePlatformTest(); }
public void SetUp() { _sqlite3Platform = new SQLitePlatformTest(); }
public void TestFixtureSetUp() { _sqlite3Platform = new SQLitePlatformTest(); }
public void SetUp() { _sqlite3Platform = new SQLitePlatformTest(); }