在此处使用 .net core 和 c# 并使用 moq 和 xunit 进行测试。我的单元测试用例结构如下:
namespace App.Test
{
public class Controller1Tests
{
[Fact]
public void Test1()
{
}
//many more tests
}
}
namespace App.Test
{
public class Controller2Tests
{
[Fact]
public void Test2()
{
}
//many more tests
}
}
namespace App.Test
{
public class DataServiceTests
{
[Fact]
public void Test3()
{
}
//many more tests
}
}
上面只是一个例子,但我有大约 8 个班级,每个班级大约有 7-8 个测试。在我的文本资源管理器中,当我单独右键单击每个类并运行测试时,所有测试都在 5-6 秒内运行良好且快速。但是当我右键单击 App.Test 命名空间并运行测试时,我的所有类测试都开始并行运行,并且该过程永远不会结束。测试继续运行,我看不到任何错误或警告,我必须停止运行测试才能停止进程。
我不确定如何进行以及在哪里寻找问题。谁能指出可能是什么问题?
谢谢