简体   繁体   中英

MSTest empty directory after test deleted

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?

MsTest似乎在执行后删除目录。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM