Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do the SetUp and TearDown methods need [RequiresSTA] if tests have it?

I can run my WatiN tests with ReSharper without issues. Each test has the RequiresSTA attribute and runs fine.

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.

What must I change to allow me to run all the tests in the TestFixture?

like image 518
Bernhard Hofmann Avatar asked Jul 11 '13 07:07

Bernhard Hofmann


1 Answers

I have met the same problem. I changed SetUp() and TearDown() methods to be public, then it worked.

like image 90
Bargitta Avatar answered Dec 14 '22 23:12

Bargitta