Exemplo n.º 1
0
 public void CachesContents()
 {
     var db = new UnreliableDb();
     _setup(db);
     var box = new LockBox(db, "Tbl", _criteria);
     Assert.True(box.Any(), "The box should not have been empty");
     // Now, we'll make the database blow up if it gets accessed again
     db.FailOnNextOp = true;
     // When we access the box again, it shouldn't make the db explode
     Assert.True(box.Any(), "This should not blow up the box");
 }
Exemplo n.º 2
0
 public void UnlockingEmptiesBox()
 {
     var db = _setup();
     var box = new LockBox(db, "Tbl", _criteria);
     Assert.True(box.Any(), "The box should not have been empty");
     box.Unlock();
     Assert.False(box.Any(), "The box should have been empty after unlocking it");
 }