8 Replies Last post: Mar 16, 2010 11:09 AM by Alexander Pasko  
Jason Hughes Newbie 7 posts since
Jun 22, 2009
Currently Being Moderated

Oct 20, 2009 2:10 PM

How to use NUnit's [TestCase] attribute

Hi I've just downloaded the first publicly available nightly build of ReSharper 5

 

Liking it so far but one of the things I was looking forward to was the native NUnit support, which I thought would mean I could use the more modern features of NUnit. 

 

Specifically the [TestCase] attribute so I can parameterise tests.

 

However my tests that use [TestCase] are not being run, and they are showing up in the editor as never used code.

 

Will this feature be added?

Do I have to change some configuration?

Or do I have to go back to using another test runner outside of ReSharper?

 

Thanks for the great work!

 

Argos

Victor Kropp JetBrains 102 posts since
May 6, 2009
Currently Being Moderated
Oct 21, 2009 9:56 AM in response to: Jason Hughes
Re: How to use NUnit's [TestCase] attribute

Sorry, missed the fact that TestCase attribute can be used without Test attribute.

Fixed now, please try next EAP build to improve your tests

Victor Kropp JetBrains 102 posts since
May 6, 2009
Currently Being Moderated
Oct 21, 2009 5:05 PM in response to: Jason Hughes
Re: How to use NUnit's [TestCase] attribute

It's pretty tricky to handle all those modern tests. For example, when using TestCaseSource test cases are created in runtime. We need to develop unified approach to handle such tests. We have some ideas how to do it, but don't have enough resources to do all cool things now.

 

You can create issue to track changes, if you wish. Don't worry we won't forget about this issue anyway.

Igor Fle Newbie 1 posts since
Oct 22, 2009
Currently Being Moderated
Oct 22, 2009 6:10 PM in response to: Victor Kropp
Re: How to use NUnit's [TestCase] attribute

A reshearper does not support a following syntax

 

 

[TestCase(12,3, Result=4)]
[TestCase(12,2, Result=6)]
[TestCase(12,4, Result=3)]
public int DivideTest(int n, int d)
{
  return( n / d );
}
Victor Kropp JetBrains 102 posts since
May 6, 2009
Currently Being Moderated
Oct 23, 2009 2:01 PM in response to: Igor Fle
Re: How to use NUnit's [TestCase] attribute

Fixed in build 1521.

jinksk Newbie 1 posts since
Feb 4, 2010
Currently Being Moderated
Feb 4, 2010 8:56 PM in response to: Victor Kropp
Re: How to use NUnit's [TestCase] attribute

Where can I find this build? All I can find is 1288.

Alexander Pasko Newbie 1 posts since
Mar 16, 2010
Currently Being Moderated
Mar 16, 2010 11:27 AM in response to: Victor Kropp
Re: How to use NUnit's [TestCase] attribute

TestCase attribute is working on beta. (5.0.1618.49)

But TestCaseSource not http://www.nunit.org/index.php?p=testCaseSource&r=2.5

More Like This

  • Retrieving data ...