运行多线程 nunit 测试的最佳方式 [英] best way to run multi-threaded nunit tests

查看:71
本文介绍了运行多线程 nunit 测试的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试寻找解决方案,如果测试方法产生的线程中发生异常,如何确保测试失败.

I currently trying to find a solution, how to ensure that a test fails if an exception occurs in a thread which is spawn by the test method.

我不想就单元测试中的多个线程展开讨论.=> "单元测试".Replace("unit","integration");

I DON'T want to start a discussion about more than one thread in a unit test. => "unit test".Replace("unit","integration");

我已经在几个论坛上阅读了很多主题,我知道 CrossThreadTestRunner,但我正在寻找一个集成到nunit中的解决方案,并且不需要重写很多测试.

I already read a lot of threads in several forums, I know about CrossThreadTestRunner, but I'm searching for a solution whichs integrates into nunit, and does not require to rewrite a lot of tests.

推荐答案

我通过为 nunit 创建一个插件解决了这个问题,它安装"了一个 ITestDecorator.

I solved the problem by creating an addin for nunit, which "installs" an ITestDecorator.

这篇关于运行多线程 nunit 测试的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆