问题描述
我可以毫无问题地使用 ReSharper 运行我的 WatiN 测试.每个测试都有 RequiresSTA 属性并且运行良好.
I can run my WatiN tests with ReSharper without issues. Each test has the RequiresSTA attribute and runs fine.
当我尝试运行类 (TestFixture) 中的所有测试时,出现以下错误:
When I try run all the tests in the class (TestFixture) I get the following error:
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
该错误并未表明我需要更改什么才能使其正常工作.
The error doesn't indicate what I need to change to make it work.
如果我在单元测试会话"窗口中选择所有被忽略的测试,我可以毫无问题地运行它们.
If I then select all the tests that have been ignored in the Unit Test Sessions window, I can run them without problems.
我必须更改哪些内容才能运行 TestFixture 中的所有测试?
What must I change to allow me to run all the tests in the TestFixture?
推荐答案
我遇到了同样的问题.我将 SetUp() 和 TearDown() 方法更改为公共方法,然后它就起作用了.
I have met the same problem. I changed SetUp() and TearDown() methods to be public, then it worked.
这篇关于如果测试有,SetUp 和 TearDown 方法是否需要 [RequiresSTA]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!