Пример #1
0
        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);
        }
Пример #2
0
 protected void ReleaseLock()
 {
    _fileLocker.ReleaseFile();
 }
Пример #3
0
 public override void Cleanup()
 {
     _fileLocker1.ReleaseFile();
     _fileLocker2.ReleaseFile();
 }