简体   繁体   English

Xunit在一个appdomain中运行所有测试

[英]Xunit run all tests in one appdomain

I have a solution in which I have several projects, a few of them are test projects. 我有一个解决方案,其中有几个项目,其中一些是测试项目。 I have shared some testing logic among those test, mainly static properties and methods. 我在这些测试中共享了一些测试逻辑,主要是静态属性和方法。 It turns out, however, that both resharper and VS test runners create one testing appdomain per assembly . 但是事实证明, 重新打包程序和VS测试运行程序都为每个程序集创建一个测试应用程序域 How can I make them run all tests in one appdomain ? 如何让他们在一个appdomain中运行所有测试 I am using XUnit v1.9 and this needs to be XUnit < 2.0. 我正在使用XUnit v1.9 ,这需要是XUnit <2.0。 I am satisfied when either Resharper test runner or VS test runner runs all tests in one appdomain. 当Resharper测试运行程序或VS测试运行程序在一个appdomain中运行所有测试时,我感到很满意。

This is a feature that xunit doesn't support, as I understand it. 据我了解,xunit不支持此功能。 Each assembly is run in a separate AppDomain. 每个程序集都在单独的AppDomain中运行。 I'd recommend posting an issue on xunit's GitHub issue tracker , but I'd also recommend removing shared state, if at all possible. 我建议在xunit的GitHub问题跟踪器上发布问题 ,但也建议尽可能删除共享状态。

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

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