public void Should_be_able_to_lock_the_file() { _fileLocker1.AccessFile(_fileThatDoesExist); bool exceptionWasThrown = false; try { _fileLocker2.AccessFile(_fileThatDoesExist); } catch (Exception) { exceptionWasThrown = true; } exceptionWasThrown.ShouldBeTrue(); _fileLocker1.ReleaseFile(); _fileLocker2.AccessFile(_fileThatDoesExist); }
protected void ReleaseLock() { _fileLocker.ReleaseFile(); }
public override void Cleanup() { _fileLocker1.ReleaseFile(); _fileLocker2.ReleaseFile(); }