Example #1
0
        public void Double_set_get()
        {
            SnapshotableDb db = new SnapshotableDb(new MemDb());

            db.Set(_hash1, _bytes1);
            db.Set(_hash1, _bytes2);
            byte[] getResult = db.Get(_hash1);
            Assert.AreEqual(_bytes2, getResult);
        }
Example #2
0
        public void Set_take_snapshot()
        {
            SnapshotableDb db = new SnapshotableDb(new MemDb());

            db.Set(_hash1, _bytes1);
            Assert.AreEqual(0, db.TakeSnapshot());
        }
Example #3
0
        public void Set_commit_get()
        {
            SnapshotableDb db = new SnapshotableDb(new MemDb());

            db.Set(_hash1, _bytes1);
            db.Commit(Frontier.Instance);
            byte[] getResult = db.Get(_hash1);
            Assert.AreEqual(_bytes1, getResult);
        }
Example #4
0
        public void Set_restore_get()
        {
            SnapshotableDb db = new SnapshotableDb(new MemDb());

            db.Set(_hash1, _bytes1);
            db.Restore(-1);
            byte[] getResult = db.Get(_hash1);
            Assert.AreEqual(null, getResult);
        }