MSTest empty directory after test deleted

余生长醉 提交于 2019-12-24 05:17:05

问题


I have a unit test (using MSTest in VS2008 or VS2010) where I create a folder like this:

[TestMethod]
public void TestMethod1()
{
    string newdir = Path.Combine(Directory.GetCurrentDirectory(), "WorkingRoot");
    Directory.CreateDirectory(newdir);
    Assert.IsTrue(true);
}

During the test when I set a breakpoint at the assert, I see that the folder has been created in the specific run folder of MSTest. But when the test has been finished, the folder has been deleted. Why?


回答1:


MsTest seems to delete empty directories after execution.



来源:https://stackoverflow.com/questions/7254030/mstest-empty-directory-after-test-deleted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!