Beispiel #1
0
        public void FileDelete_OnDirectoryThrowsUnauthorizedAccessException()
        {
            // Arrange
            var fs = new MockFileSystem();
            const string fileName = "c:\\test\\";
            fs.CreateDirectory(fileName);

            // Act
            fs.DeleteFile(fileName);

            // Assert
            Assert.Fail();
        }
Beispiel #2
0
        public void FileDelete_RemovesFile()
        {
            // Arrange
            var fs = new MockFileSystem();
            const string fileName = "c:\\test\\file1.txt";
            fs.AddFile(fileName, 255);

            // Act
            fs.DeleteFile(fileName);

            // Assert
            Assert.IsFalse(fs.FileExists(fileName));
        }
Beispiel #3
0
        public void FileDelete_DeletingNonExistantFileDoesNotFail()
        {
            // Arrange
            var fs = new MockFileSystem();
            const string fileName = "c:\\test\\Horker.txt";

            // Act
            fs.DeleteFile(fileName);

            // Assert
        }