[Issue]: Unit Test Runner and SetUp attribute

Consider this code:


public void TestInitialize()
{
// test setup code
}

When I compile this code and run the Unit Test Runner, this shows up as
a test.

If I modify the method name and call it 'SetUp', everything works just
fine. Thinking that it may have had to do with old nunit code that
inferred everything that was prefixed with Test was actually a test, I
tried that. That too works.

However, I thought that NUnit no longer is doing this type of thing. Id
like to see Resharper support the name TestInitialize as well. This is a
name that Ive carried over and really prefer for my initialization routines.

--
Matt Berther
http://www.mattberther.com

2 comments
Comment actions Permalink

I agree with this 100%

We use "TestSetup" as method names for our setup methods... such methods
should not be considered tests if the attribute specfied isn't "[Test]".


"Matt Berther" <matt.berther@gmail.com> wrote in message
news:dtj5on$bpl$1@is.intellij.net...

Consider this code:

>


public void TestInitialize()
{
// test setup code
}

>

When I compile this code and run the Unit Test Runner, this shows up as a
test.

>

If I modify the method name and call it 'SetUp', everything works just
fine. Thinking that it may have had to do with old nunit code that
inferred everything that was prefixed with Test was actually a test, I
tried that. That too works.

>

However, I thought that NUnit no longer is doing this type of thing. Id
like to see Resharper support the name TestInitialize as well. This is a
name that Ive carried over and really prefer for my initialization
routines.

>

--
Matt Berther
http://www.mattberther.com



0
Comment actions Permalink

Fixed in 220

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Matt Berther" <matt.berther@gmail.com> wrote in message
news:dtj5on$bpl$1@is.intellij.net...

Consider this code:

>


public void TestInitialize()
{
// test setup code
}

>

When I compile this code and run the Unit Test Runner, this shows up as a
test.

>

If I modify the method name and call it 'SetUp', everything works just
fine. Thinking that it may have had to do with old nunit code that
inferred everything that was prefixed with Test was actually a test, I
tried that. That too works.

>

However, I thought that NUnit no longer is doing this type of thing. Id
like to see Resharper support the name TestInitialize as well. This is a
name that Ive carried over and really prefer for my initialization
routines.

>

--
Matt Berther
http://www.mattberther.com



0

Please sign in to leave a comment.