本文介绍了nunit扩展/行测试发生了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在NUnit 2.4.7中,包含了nunit.framework.extensions.dll,从而可以进行RowTest.

In NUnit 2.4.7, nunit.framework.extensions.dll was included which made it possible to do RowTests.

在下载最新版本(2.5.8)时,我找不到它.怎么了?

When downloading the newest version (2.5.8) I can't find it. What happened to it?

推荐答案

可以使用TestCase代替使用RowTest.以前使用RowTest进行的测试如下:

Instead of using RowTest, you can use TestCase. A previous testing using RowTest would look like:

[RowTest]
[Row("foo", false)]
[Row("", true)]
public void Some_test(string value, bool expected)
{
  // test
}

TestCase相同的东西看起来像这样:

And the same thing with TestCase looks like this:

[TestCase("foo", false)]
[TestCase("", true)]
public void Some_test(string value, bool expected)
{
  // test
}

这篇关于nunit扩展/行测试发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 19:56