gpt4 book ai didi

c# - 删除测试后的 MSTest 空目录

转载 作者:太空宇宙 更新时间:2023-11-03 14:12:52 26 4
gpt4 key购买 nike

我有一个单元测试(在 VS2008 或 VS2010 中使用 MSTest),我在其中创建了一个这样的文件夹:

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

测试的时候在assert下断点,看到MSTest的具体运行文件夹下已经创建了文件夹。但是当测试完成后,该文件夹已被删除。为什么?

最佳答案

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

关于c# - 删除测试后的 MSTest 空目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7254030/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com