xunitcontrib-resharper 0.7 - ReSharper 7.1 and stuff

by Matt 20. November 2012 03:39

ReSharper has just released 7.1, so I think it’s only fair to update the xUnit.net test runner to support it.

And it would be mean not to throw in a couple of bug fixes while I’m at it.

Firstly, there’s a fix to support filtering out test usages when using ReSharper’s Find Usages command. Frankly, I thought this was working ages ago, but it looks like I broke it some time back. Sorry folks.

When in the Find Results window, displaying the usages of a type, method, property, etc. you can filter out different types of usage – read/write, invocation, usage in attributes or documentation, and, what’s interesting here, usages in tests. This means you can hide any usage of a type from a test method or class. Simply toggle the “Show Unit Test Usages” menu item in the filter, and the Results window will hide and show the test usages (note that the test usages are using the test icon that appears next to the test method in the code editor).


The second bug fix relates to Theory data rows. xUnit.net uses class and method names as a means of identifying a test. This is guaranteed to be a unique value, as the test method doesn’t run more than once. For Theory parameterised tests, xunit uses the class and method name, but also uses a display name, which includes the parameter values, such as “ShouldBeUppercase(s: SAUSAGES)”.

There is a problem here. If you have two rows of data with the same value (“SAUSAGES”), the test runner treats these as the same test. This is a case of “doctor, doctor, it hurts when I do this”. Don’t do this. You’re passing in the same data, you’ll get the same results, it doesn’t matter if it looks like there’s only one test.

Or so I thought.

What happens if the data being passed in is an array of strings? xunit will call ToString on the parameter value, and come up with a display name like “ShouldBeUppercase(s: System.String[])”. Clearly, there are going to be collisions here. So now, the test runner keeps a track of names of tests it’s already run. If it tries to run the same test again, it changes the name, appending a call number, e.g. “ShouldBeUppercase(s: System.String[])” and “ShouldBeUppercase(s: System.String[]) [2]”, “… [3]” and so on.


And that’s it for this release. I smell a 1.0 version coming, finally. There are a couple of big ticket changes I want to make first. I want better support for PropertyDataAttribute (IntelliSense, find usages, ctrl-click navigation, etc) and InlineDataAttribute, and there’s a good memory optimisation I need to make for editing a large test file. If there’s anything else missing or broken, now’s a good time to let me know!

As ever, download it from Codeplex, install it with the handy batch file, let me know any issues.

Tags: , ,


Comments (16) -

11/20/2012 9:48:04 AM #

Works great and with dotCover EAP in R# 7.1.


Supplier Tas Kw Murah di Solo
Supplier Tas Kw Murah di Solo United States
11/9/2013 6:24:30 PM #

very nice post, i certainly love this website, keep on it


360storage United States
5/18/2015 2:58:44 PM #

I sign into my Tumblr account, and switch the dashboard from my main blog to the secondary blog, then I go to Account > Preferences > Customize your blog, but then it just takes me to the customization page for my main blog. Any way to customize my secondary blog, or should I just create a second account altogether?.


cairns solar
cairns solar United States
5/18/2015 3:07:26 PM #

Not many writers impress me with their informative articles, but you have done it. This is great work and very interesting content. Thanks for posting.


Rico Petronis
Rico Petronis United States
1/6/2016 3:23:23 PM #

Congrats! So glad to see this site getting the recognition it deserves, the world can always use a little more awesome.


link building 2015
link building 2015 United States
1/9/2016 6:11:50 AM #

Remarkable! Merely all the good words use to this material! Thank you from the base of my heart and also spirit and I will certainly come check out again if you keep up the good job!


Leonel Marturano
Leonel Marturano United States
1/15/2016 4:15:18 AM #

Congrats. And all of the items featured so far should be in the book.


Kylee Marett
Kylee Marett United States
1/15/2016 4:22:53 AM #

The dolphin saving you one is the best one!


Mitch Groene
Mitch Groene United States
1/15/2016 4:51:19 AM #

yeah, except the "dolphin saving you" one


Brandon Penhallurick
Brandon Penhallurick United States
1/15/2016 4:53:12 AM #

getting laid AWSOME


Jeannine Mischel
Jeannine Mischel United States
1/15/2016 5:33:01 AM #

Let me be the first to say: Congrats, Neil! I've been following this site from day one, and have loved every single day of awesomeness that it has delivered. You deserve all the success coming your way. Keep it up!AWESOME!


Dia Staab
Dia Staab United States
1/15/2016 5:45:27 AM #

Thaaaat IS awesome! lol hehe


Kris United States
4/1/2016 1:58:36 PM #

Hello I know as a fellow blogger that it can be sometimes really difficult to get people to read your stuff. So I had a freelance do this new tool that you should definitely try. A free Twitter Tumblr automation tool that will help you get your content seen by plenty of people. Get it here now http://bit.ly/Free-Bots If you like it tweet me what you think on @Automationbots. Cheers!


high pr backlinks
high pr backlinks United States
4/9/2016 9:53:39 AM #

Merely spectacular! I recognize you have placed a lot of initiative into this and also I really wanted to tell you how happy I am! Hope you put out also a lot more remarkable things in the close to future and I will certainly come back as well as review it!


gay singles
gay singles United States
4/11/2016 7:34:07 PM #

<p>Ordered 2 with pics of my girls on both. Came out great, good quality. Very happy!</p>


free gay chat uk
free gay chat uk United States
4/21/2016 2:35:46 PM #

Thank you very much so much for grant this important info. This is the very best option for entertainment. These are the very best game & everyone can fully enjoy following these games. Because i am also play these games. Anticipation so these games have a positive response you are able to good feedback simultaneously.</p><p>I spend a lot of time for these particular type of games. Finally, Before at times i was installed. SoftMozer is usually a free software application downloading site offering


Pingbacks and trackbacks (1)+

Add comment

  • Comment
  • Preview


Month List


Comment RSS