예제 #1
0
파일: LockBoxTests.cs 프로젝트: badjer/Lasy
 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");
 }
예제 #2
0
파일: LockBoxTests.cs 프로젝트: badjer/Lasy
 protected UnreliableDb _setup(UnreliableDb db = null)
 {
     db = db ?? new UnreliableDb();
     db.Insert("Tbl", new { ShouldProcess = true, LockId = DBNull.Value, LockDate = DBNull.Value });
     return db;
 }