Example #1
0
        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());
            }
        }
Example #2
0
        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());
            }
        }
Example #3
0
 public void TestFixtureSetUp()
 {
     _sqlite3Platform = new SQLitePlatformTest();
 }
Example #4
0
 public void SetUp()
 {
     _sqlite3Platform = new SQLitePlatformTest();
 }
Example #5
0
 public void TestFixtureSetUp()
 {
     _sqlite3Platform = new SQLitePlatformTest();
 }
Example #6
0
 public void SetUp()
 {
     _sqlite3Platform = new SQLitePlatformTest();
 }