Esempio n. 1
0
        public void SuccessfulSavepointTransaction()
        {
            db.RunInTransaction(() => {
                db.Delete(testObjects[0]);
                db.Delete(testObjects[1]);
                db.Insert(new TestObj());
            });

            Assert.AreEqual(testObjects.Count - 1, db.Table <TestObj>().Count());
        }
Esempio n. 2
0
        public void Delete()
        {
            var query =
                from p in db.Table <Product>()
                select p;

            Assert.AreEqual(0, changeCount);
            Assert.AreEqual(22, query.Count());

            var pr = query.First();

            pr.Price = 10000000;
            db.Delete(pr);

            Assert.AreEqual(1, changeCount);
            Assert.AreEqual(21, query.Count());

            db.DeleteAll <Product>();

            Assert.AreEqual(2, changeCount);
            Assert.AreEqual(0, query.Count());
        }