Patrick Peters
Patrick Peters

Reputation: 9568

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?

Upvotes: 2

Views: 353

Answers (1)

Abdourakhmane
Abdourakhmane

Reputation: 26

MsTest seems to delete empty directories after execution.

Upvotes: 1

Related Questions