简体   繁体   English

有没有办法*防止* ReSharper 并行运行程序集的单元测试?

[英]Is there a way to *prevent* ReSharper from running an assembly's unit tests in parallel?

I see an option in the Unit Testing settings to "Run up to 1|2" assemblies in parallel", but setting this to "1" still seems to execute a single assembly's tests in parallel. Is there a way to disable parallel execution altogether?我在单元测试设置中看到一个选项“并行运行最多 1|2”个程序集”,但将其设置为“1”似乎仍然并行执行单个程序集的测试。有没有办法完全禁用并行执行?

This is ReSharper 6.1.这是 ReSharper 6.1。

You can try looking at the stack overflow answer here How to run NUnit test fixtures serially?您可以尝试在此处查看堆栈溢出答案How to run NUnit test fixtures serially?

However, it would seem that your need to do this might be fuelled by test dependencies.但是,似乎您需要执行此操作可能会受到测试依赖性的推动。 Either the need to access common resources or the output of one test needing to be the input of another.要么需要访问公共资源,要么需要将一个测试的 output 作为另一个测试的输入。 If this is the case, please consider refactoring your test/code in order to remove the dependency.如果是这种情况,请考虑重构您的测试/代码以消除依赖性。 Commonly this can be done by using a mocking framework (Moq, RhinoMocks, etc).通常这可以通过使用 mocking 框架(Moq、RhinoMocks 等)来完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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