如何写一个NUnit测试为NUnit的加载项? [英] How to write a NUnit test for an NUnit add-in?

查看:216
本文介绍了如何写一个NUnit测试为NUnit的加载项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的<一个变化href=\"http://stackoverflow.com/questions/1131758/nunit-cleanup-after-test-failure/1134689#1134689\">this堆栈溢出的答案,提供测试可靠的清理。你怎么写NUnit的加载项单元测试?

I'm working on a variation of this stack overflow answer that provides reliable cleanup of tests. How do you write unit tests for NUnit addins?

研究如何NUnit的自检,我已经确定:

Examining how NUnit self tests, I have determined:


  • 您可以编写测试,即通过,即验证NUnit的正确行为的测试失败。

  • 您写在一个单独的组件(否则被测装置将与您的单元测试执行)对测试夹具单元测试

  • 使用NUnit.TestUtilities.TestBuilder创建夹具和调用TestSuite.Run方法。

我看不出有外接过程中的任何测试。我有安装和执行之间的某个时候发生的错误。如何将我的单元测试实现以下?

What I don't see are any tests of the add-in process. I've got errors occurring sometime between install and execution. How would I unit test implementations the following?


  • IAddin.Install

  • ITestDecorator.Decorate

推荐答案

下面的人谁入侵了一个办法做到这一点的文章:操纵一些NUnit的单身的附加实施交换自己附加在与出去。

Here's an article by someone who hacked a way to do it: manipulating some of the singletons in the NUnit add-in implementation to swap his add-in in and out.

HTTP://www.bryancook。净/ 2009/09 /测试中的NUnit - 加载项由内而外地-nunit.html

这篇关于如何写一个NUnit测试为NUnit的加载项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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