public void Clean_ReturnFalse_When_FileRemainsAfterCleaningDirectory() { var actual = true; LogAssert.Expect(LogType.Exception, new Regex("Exception")); using (var filestream = System.IO.File.Open(AbsolutePathToFile, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None)) { actual = Directory.Clean(AbsolutePathToExistingNonEmptyDirectory); } Assert.False(actual); }
public void Clean_ReturnTrue_WhenPassing_AbsolutePathToExistingNonEmptyDirectory() { var actual = Directory.Clean(AbsolutePathToExistingNonEmptyDirectory) && !System.IO.Directory.Exists(AbsolutePathToFile); Assert.True(actual); }
public void Clean_ReturnTrue_WhenPassing_AbsolutePathToExistingEmptyDirectory() { var actual = Directory.Clean(AbsolutePathToExistingEmptyDirectory); Assert.True(actual); }
public void Clean_ReturnFalse_WhenPassing_AbsolutePathToNonExistingDirectory() { var actual = Directory.Clean(AbsolutePathToNonExistingDirectory); Assert.False(actual); }
public void Clean_ReturnFalse_WhenPassing_AbsolutePathToFile() { var actual = Directory.Clean(AbsolutePathToFile); Assert.False(actual); }
public void Clean_ReturnFalse_WhenPassing_AbsolutePathContainingInvalidCharacters() { var actual = Directory.Clean(AbsolutePathContainingInvalidCharacters); Assert.False(actual); }
public void Clean_ReturnFalse_WhenPassing_EmptyString() { var actual = Directory.Clean(EmptyString); Assert.False(actual); }