public void CleanUpRemovesDirectory() { using (var temporaryDirectory = new TemporaryDirectory()) { Assume.That(temporaryDirectory.FullPath, Does.Exist); temporaryDirectory.CleanUp(); Assert.That(temporaryDirectory.FullPath, Does.Not.Exist); } }
public void CleanUpRemovesNotEmptyDirectory() { using (var temporaryDirectory = new TemporaryDirectory()) { Assume.That(temporaryDirectory.FullPath, Does.Exist); File.WriteAllText(Path.Combine(temporaryDirectory.FullPath, "test.txt"), ""); temporaryDirectory.CleanUp(); Assert.That(temporaryDirectory.FullPath, Does.Not.Exist); } }