public void Can_get_all_on_empty() { IDbConfig config = new DbConfig(); DbOnTheRocks db = new BlocksRocksDb("testIterator", config); try { db.GetAll().ToList(); } finally { db.Clear(); db.Dispose(); } }
public async Task Dispose_while_writing_does_not_cause_access_violation_exception() { IDbConfig config = new DbConfig(); DbOnTheRocks db = new BlocksRocksDb("testDispose1", config); Task task = new Task(() => { while (true) { db.Set(Keccak.Zero, new byte[] { 1, 2, 3 }); } }); task.Start(); await Task.Delay(100); db.Dispose(); await Task.Delay(100); task.Dispose(); }