如果测试有,那么SetUp和TearDown方法是否需要[RequiresSTA]?

Ber*_*ann 5 resharper nunit watin

我可以毫无问题地使用ReSharper运行我的WatiN测试.每个测试都具有RequiresSTA属性并且运行正常.

当我尝试在类中运行所有测试(TestFixture)时,我收到以下错误:

One or more child tests had errors
Exception doesn't have a stacktrace
<testname>  ignored: Invalid signature for SetUp or TearDown method: TestSetup
<testname>  ignored: Invalid signature for SetUp or TearDown method: TestSetup
<testname>  ignored: Invalid signature for SetUp or TearDown method: TestSetup
Run Code Online (Sandbox Code Playgroud)

该错误并不表示我需要更改以使其工作.

如果我然后选择在单元测试会话窗口中忽略的所有测试,我可以毫无问题地运行它们.

我必须更改什么才能让我在TestFixture中运行所有测试?

Bar*_*tta 20

我遇到了同样的问题.我将SetUp()和TearDown()方法更改为公共,然后它工作.