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