public static void UseDatastore(Action <LeveldbDatastore> action) { UseTempDir(temp => { using (var ds = new LeveldbDatastore(temp)) { action(ds); } }); }
public static void AddTestCases(LeveldbDatastore ds, Dictionary <DatastoreKey, string> testcases) { foreach (var testcase in testcases) { ds.Put(testcase.Key, Encoding.UTF8.GetBytes(testcase.Value)); } foreach (var testcase in testcases) { var v2 = ds.Get(testcase.Key); var v2s = Encoding.UTF8.GetString(v2); Assert.That(v2s, Is.EqualTo(testcase.Value)); } }