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).

FilterTestUsages

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.

RepeatedTheoryNames

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: , ,

xunitcontrib

Comments (48) -

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

Works great and with dotCover EAP in R# 7.1.

Reply

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

Reply

360storage
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?.

Reply

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.

Reply

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.

Reply

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!

Reply

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.

Reply

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

The dolphin saving you one is the best one!

Reply

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

yeah, except the "dolphin saving you" one

Reply

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

getting laid AWSOME

Reply

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!

Reply

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

Thaaaat IS awesome! lol hehe

Reply

Kris
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!

Reply

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!

Reply

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>

Reply

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

Reply

pożyczka pozabankowa
pożyczka pozabankowa United States
6/23/2016 8:02:24 AM #

POŻYCZKA

Reply

pożyczka pozabankowa
pożyczka pozabankowa United States
6/23/2016 8:02:27 AM #

POŻYCZKI

Reply

pożyczki
pożyczki United States
6/23/2016 8:02:28 AM #

POŻYCZKI POZABANKOWE

Reply

pożyczki
pożyczki United States
6/23/2016 8:11:10 AM #

Weź bezpłatną pożyczkę    Gotówka na koncie w czasie nawet do 15 minut     Pożycz do 2000 złotych

Reply

pożyczki
pożyczki United States
6/23/2016 8:11:10 AM #

POŻYCZKI

Reply

POŻYCZKI POZABANKOWE
POŻYCZKI POZABANKOWE United States
6/23/2016 8:11:11 AM #

Pożyczka gotówkowa Wonga

Reply

POŻYCZKI POZABANKOWE
POŻYCZKI POZABANKOWE United States
6/23/2016 8:13:18 AM #

POŻYCZKA

Reply

pożyczka pozabankowa
pożyczka pozabankowa United States
6/23/2016 8:13:18 AM #

Pożyczka pozabankowa Aasa Polska

Reply

POŻYCZKI
POŻYCZKI United States
6/23/2016 8:13:19 AM #

Pożyczka gotówkowa Alior Bank

Reply

POŻYCZKI POZABANKOWE
POŻYCZKI POZABANKOWE United States
6/23/2016 8:13:21 AM #

POŻYCZKI

Reply

pożyczka pozabankowa
pożyczka pozabankowa United States
6/23/2016 8:17:30 AM #

pierwsza pożyczka za 0 zł! Bez dodatkowych opłat i prowizji    okres kredytowania aż do 35 dni    dla stałych klientów nawet 4 000 zł bez zabezpieczenia    możliwość spłaty w ratach!

Reply

domeny
domeny United States
6/25/2016 6:14:37 AM #

Zamówienie domeny

Reply

REJESTRACJA DOMEN
REJESTRACJA DOMEN United States
6/25/2016 6:14:37 AM #

rejestracja domen

Reply

Rejestracja Domen
Rejestracja Domen United States
6/25/2016 6:14:38 AM #

Rejestracja Domen

Reply

DOMENY
DOMENY United States
6/25/2016 6:14:40 AM #

BEZPŁATNE KONTO HOSTINGOWE 5GB DLA KAŻDEJ REJESTRACJI NOWEJ POLSKIEJ DOMENY!

Reply

REJESTRACJA DOMEN
REJESTRACJA DOMEN United States
6/25/2016 6:14:40 AM #

Bezpłatna rejestracja domen

Reply

domeny
domeny United States
6/25/2016 6:22:53 AM #

Bezpłatna rejestracja domen

Reply

REJESTRACJA DOMEN
REJESTRACJA DOMEN United States
6/25/2016 6:22:53 AM #

rejestracja domen

Reply

Rejestracja Domen
Rejestracja Domen United States
6/25/2016 6:22:54 AM #

Rezerwacja domen Rejestracja domen

Reply

REJESTRACJA DOMEN
REJESTRACJA DOMEN United States
6/25/2016 6:24:58 AM #

REJESTRACJA DOMEN

Reply

Rejestracja Domen
Rejestracja Domen United States
6/25/2016 6:25:00 AM #

rejestracja domen

Reply

rejestracja domen
rejestracja domen United States
6/25/2016 6:25:00 AM #

Rejestracja domen - Przedłużanie domen - Transfer domen

Reply

rejestracja domen
rejestracja domen United States
6/25/2016 6:25:03 AM #

REJESTRACJA DOMEN

Reply

domeny
domeny United States
6/25/2016 6:25:03 AM #

Rejestracja Domen

Reply

REJESTRACJA DOMEN
REJESTRACJA DOMEN United States
6/25/2016 6:28:52 AM #

Transfer domen

Reply

blog post writing
blog post writing United States
7/16/2016 11:47:20 PM #

Not merely high quality, but also useful info. As well as that is rare to come by these days! I have to say that I am truly pleased and will surely come back once more if you maintain up the high quality as well as value of the content at this level, or even acquire it on the next degree.

Reply

Randy Nault
Randy Nault United States
7/20/2016 7:43:26 AM #

Take my word for it, it's not as easy as you think

Reply

James Fly
James Fly United States
8/7/2016 12:51:46 AM #

This is such a great site come check out our new free dating website we are world wide find your true love at http://youllfindlove.com

Reply

Beverly Bell
Beverly Bell United States
8/16/2016 8:11:49 PM #

Have you ever considered about adding a little bit more than just your articles? I mean, what you say is important and all. Nevertheless think of if you added some great pictures or video clips to give your posts more, "pop"! Your content is excellent but with pics and videos, this site could certainly be one of the most beneficial in its field. Good blog!

Reply

Kathie Digian
Kathie Digian United States
8/25/2016 4:24:24 AM #

Howdy! I’m at work browsing your blog from my new Samsung. Just would like to say I love reading through your blog and look forward to all your posts! Keep up the good work!

Reply

Marisa Lado
Marisa Lado United States
9/21/2016 9:03:55 AM #

What’s Taking place i am new to this, I stumbled upon this I have discovered It positively useful and it has aided me out loads. I'm hoping to give a contribution & aid different customers like its aided me. Good job.

Reply

James Fly
James Fly United States
9/26/2016 8:56:29 AM #

Это такой хороший сайт с большим количеством полезной информации . Приходите присоединиться к нашему новый бесплатный социальный сайт, как Facebook . У нас есть группы друзей , объявления, сайт знакомств играть в игры бесплатно для всех на http://mysocialspot.ca/

Reply

Pingbacks and trackbacks (1)+

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS