public void DeleteDirectoriesIfEmpty_Will_Not_Delete_Directory_With_Content() { var pathLimit = PartialProjectSetupFixture.TestingAreaPath; var basePath = Path.Combine(pathLimit, "Dir1"); var filePath = Path.Combine(basePath, "testfile.txt"); var contentBytes = Encoding.UTF8.GetBytes("namespace SomeNS { public class NewClass {} }"); _projectBuilder.WriteFileBytesToProject(filePath, contentBytes); _projectBuilder.DeleteDirectoriesIfEmpty(basePath, pathLimit); Assert.True(Directory.Exists(basePath)); Assert.True(File.Exists(filePath)); Directory.Delete(basePath, true); }