public void BasicPersistentGetAndSet()
{
string path = Path.GetFullPath("TestData\\BasicPersistentGetAndSet");
using (var db = new KeyValueStore(path)) {
db.Truncate();
for (int i = 0; i < 10; i++) {
byte[] key = BitConverter.GetBytes(i);
byte[] value = Encoding.UTF8.GetBytes("Number " + i.ToString());
db.Set(key, value);
}
}
using (var db = new KeyValueStore(path)) {
for (int j = 0; j < 15; j++) {
byte[] key = BitConverter.GetBytes(j);
byte[] value = db.Get(key);
if (j < 10) {
Assert.AreEqual(Encoding.UTF8.GetBytes("Number " + j.ToString()), value);
} else {
Assert.IsNull(value);
}
}
}
}