public void SimpleFindPreviousKeyWorks()
{
using (var fileCollection = new InMemoryFileCollection())
using (IKeyValueDB db = new KeyValueDB(fileCollection))
{
using (var tr1 = db.StartTransaction())
{
tr1.CreateKey(_key1);
tr1.CreateKey(Key2);
tr1.CreateKey(_key3);
tr1.Commit();
}
using (var tr2 = db.StartTransaction())
{
Assert.True(tr2.FindExactKey(_key3));
Assert.True(tr2.FindPreviousKey());
Assert.Equal(_key1, tr2.GetKeyAsByteArray());
Assert.False(tr2.FindPreviousKey());
}
}
}