public void WhenFileIsNotLocked_ThenReturnFalse() { var fileInfo = FileBuilder.InFileSystem.WithPath(Path.Combine(WorkingDir, "Test1.txt")).Build(); var result = FileLocker.IsLocked(fileInfo); Assert.That(result, Is.False); }
public void WhenFileIsLocked_ThenUnlock() { var fileInfo = FileBuilder.InFileSystem.WithPath(Path.Combine(WorkingDir, "Test1.txt")).Build(); FileLocker.Lock(fileInfo); FileLocker.Unlock(fileInfo); Assert.That(FileLocker.IsLocked(fileInfo), Is.False); }
public void WhenFileDoesNotExist_ThenThrowException() { Assert.Throws <FileNotFoundException>(() => FileLocker.IsLocked(FileNotExist)); }
public void WhenFileInfoIsNull_ThenThrowException() { Assert.Throws <ArgumentNullException>(() => FileLocker.IsLocked(null as FileInfo)); }
public void WhenIsNullOrEmpty_ThenThrowException(string filePath) { Assert.Throws <ArgumentException>(() => FileLocker.IsLocked(filePath)); }