Пример #1
0
 public void TestReadWriteUnlock()
 {
     var testDir = new DirectoryInfo(Path.Combine(tempDir.FullName, Guid.NewGuid().ToString()));
     testDir.Create();
     using (var lockFile = File.Create(Path.Combine(testDir.FullName, "readwrite.lock"))) { }
     var locker = new DirectoryLocker(testDir.FullName);
     locker.ReadWriteUnlock();
     Assert.AreEqual(0, testDir.GetFiles("readwrite.lock").Count());
 }
Пример #2
0
 private void ReadWriteUnLock(DirectoryLocker locker, int waitSeconds)
 {
     Thread.Sleep(waitSeconds * 1000);
     locker.ReadWriteUnlock();
 }