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); }
public void Set_take_snapshot() { SnapshotableDb db = new SnapshotableDb(new MemDb()); db.Set(_hash1, _bytes1); Assert.AreEqual(0, db.TakeSnapshot()); }
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); }
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); }