示例#1
0
        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);
        }
示例#2
0
        public void Clean_ReturnTrue_WhenPassing_AbsolutePathToExistingNonEmptyDirectory()
        {
            var actual = Directory.Clean(AbsolutePathToExistingNonEmptyDirectory) && !System.IO.Directory.Exists(AbsolutePathToFile);

            Assert.True(actual);
        }
示例#3
0
        public void Clean_ReturnTrue_WhenPassing_AbsolutePathToExistingEmptyDirectory()
        {
            var actual = Directory.Clean(AbsolutePathToExistingEmptyDirectory);

            Assert.True(actual);
        }
示例#4
0
        public void Clean_ReturnFalse_WhenPassing_AbsolutePathToNonExistingDirectory()
        {
            var actual = Directory.Clean(AbsolutePathToNonExistingDirectory);

            Assert.False(actual);
        }
示例#5
0
        public void Clean_ReturnFalse_WhenPassing_AbsolutePathToFile()
        {
            var actual = Directory.Clean(AbsolutePathToFile);

            Assert.False(actual);
        }
示例#6
0
        public void Clean_ReturnFalse_WhenPassing_AbsolutePathContainingInvalidCharacters()
        {
            var actual = Directory.Clean(AbsolutePathContainingInvalidCharacters);

            Assert.False(actual);
        }
示例#7
0
        public void Clean_ReturnFalse_WhenPassing_EmptyString()
        {
            var actual = Directory.Clean(EmptyString);

            Assert.False(actual);
        }