DeleteFile() public method

public DeleteFile ( string fileName ) : void
fileName string
return void
Exemplo n.º 1
0
        public void DeleteFileSilentlyFailsForNonExistantFile()
        {
            // Arrange
            PhysicalFileSystem fs = new PhysicalFileSystem(testRoot);

            // Act
            fs.DeleteFile("testDeleteNonExistant.txt");

            // Assert
            Assert.False(File.Exists(ResolveTestFile("testDeleteNonExistant.txt")));
        }
Exemplo n.º 2
0
        public void DeleteFileDeletesPhysicalFileIfExists()
        {
            // Arrange
            PhysicalFileSystem fs = new PhysicalFileSystem(testRoot);
            WriteTestFile("testDelete.txt");

            // Act
            fs.DeleteFile("testDelete.txt");

            // Assert
            Assert.False(File.Exists(ResolveTestFile("testDelete.txt")));
        }