2

我有一些自定义属性用于使用 nunit 2.6 编写测试。我最近(通过 Nuget)升级到 nunit 3.0。升级后,我所有的操作属性都无法构建。我看到那TestDetails已经消失了,这就是为什么我的属性不会建立的原因。

阅读此处的文档http://nunit.org/index.php?p=actionAttributes&r=3.0,看起来它们应该仍然可以工作。使用该文档页面上提供的 ConsoleActionAttribute 时出现的错误是:

SetUp : System.ArgumentNullException : Value cannot be null.
Parameter name: type
TearDown : System.ArgumentNullException : Value cannot be null.
Parameter name: type

各种其他属性会引发类似的错误,例如

TestFixtureSetUp failed in SomeTestClass

在 Action Attribute 的 Before/After 方法中访问测试的 Fixture 属性的正确方法是什么?

4

0 回答 0