Esempio n. 1
0
        public void DeleteNull()
        {
            var litedb = new LiteDBDAL();

            var result = litedb.DeleteItem <TestObject>(null);

            Assert.IsFalse(result);
        }
Esempio n. 2
0
        public void DeleteMiss()
        {
            var litedb = new LiteDBDAL();

            var result = litedb.DeleteItem(new TestObject());

            Assert.IsFalse(result);
        }
Esempio n. 3
0
        public void ContainsMiss()
        {
            var litedb = new LiteDBDAL();

            var contains = litedb.Contains <TestObject>(a => a.ID == 0);

            Assert.IsFalse(contains);
        }
Esempio n. 4
0
        public void ContainsNullItem()
        {
            var litedb = new LiteDBDAL();

            var contains = litedb.Contains <TestObject>(a => a == null);

            Assert.IsFalse(contains);
        }
Esempio n. 5
0
        public void GetNullItem()
        {
            var litedb = new LiteDBDAL();

            var val = litedb.GetItem <TestObject>(a => a.ID == 0);

            Assert.IsNull(val);
        }
Esempio n. 6
0
        public void ContainsHit()
        {
            var litedb = new LiteDBDAL();

            var resultID = litedb.AddItem(new TestObject());

            Assert.IsTrue(resultID > 0);

            var contains = litedb.Contains <TestObject>(a => a.ID == resultID);

            Assert.IsTrue(contains);
        }
Esempio n. 7
0
        public void DeleteHit()
        {
            var litedb = new LiteDBDAL();

            var deleteResult = litedb.DeleteAll <TestObject>();

            Assert.IsTrue(deleteResult);

            var resultID = litedb.AddItem(new TestObject());

            var item = litedb.GetItem <TestObject>(a => a.ID == resultID);

            Assert.IsNotNull(item);

            var result = litedb.DeleteItem(item);

            Assert.IsTrue(result);
        }
Esempio n. 8
0
 protected override void CreateDbFile(LiteDBDAL litedbDal)
 {
     litedbDal.CreateDbFile <NeuraliumWalletTimeline, long>(i => i.Id);
     litedbDal.CreateDbFile <NeuraliumWalletTimelineDay, int>(i => i.Id);
 }