xunitcontrib + ReSharper 4.5.1

by Matt 31. July 2009 16:03

Just the other day, JetBrains released ReSharper 4.5.1. There are no major changes; it’s a maintenance release.

And the good news is, the latest version of xunitcontrib (0.3.1) works just fine with it. No changes. Nothing.

But there’s one nice, new, quiet, little feature.

ReSharper 4.5 added naming style rules, such that you would get a visible squiggly warning when classes weren’t named InCamelCase and variables weren’t lowerCaseCamel.

Too bad for those upstart BDD folks that like to ape Ruby with Significant_use_of_the_underscore_character when naming their tests (“underscore porn”). These guys would get a warning under their test methods.

ReSharper warns that test method does not match naming standard

We can fix this in 4.5.1 by adding a user defined naming rule. Go to the ReSharper options dialog, and select Naming Style from the tree on the left hand side. Then select Add in the bottom half of this dialog. We get a new window:

The ReSharper user defined naming rule dialog

We want to set the rule just as in the picture – give it a description, select Test type and Test method (property) and then select First_upper.

And now our Interestingly_named_methods are no longer marked as being non-standard, and our “normally” named tests are prompted for renaming.

BoringCSharpNamingStandard

Cool. But what about your existing, non-BDD style tests? You don’t have to rename those. Simply add a new naming style to the rule you’ve just created. So not only does the rule for test elements enforce Uppercase_with_underscores, it also enforces UpperCamelCase. Very handy.

And in case you missed why I’m pointing this out, ReSharper is smart enough to realise that this rule applies to any test identified by a test provider, such as xunitcontrib. Those examples above are xunit Facts.

And the best bit? I didn’t have to do any work.

Tags: , ,

Comments (29) -

Peddos
Peddos
4/19/2011 11:00:05 AM #

I really loved your blog! I got a porno for you, check it out.

Reply

some free stuff
some free stuff
5/6/2011 8:24:49 PM #

thats very well written =]. i do find most of the stuff you have mentioned very useful and connecting to my audiences. if only i have learnt about all this stuff earlier. i only discovered them in recent months.

Reply

suv comparison
suv comparison
7/20/2011 10:25:43 PM #

Per il tuo bambino scegli Moncler. Una scelta di capi, estivi ed invernali, eccezionali. Tuo figlio sarà sempre alla moda e potrà muoversi in totale comodità.

Reply

hybrid vehicle
hybrid vehicle
7/21/2011 12:48:28 PM #

Fantastic task I like your type! Would really like to right here your feedback on my website! I am also seeking for someone to help you me make websites!

Reply

Douglas Ramler
Douglas Ramler United States
1/6/2016 2:49:39 PM #

Congratulations, Neil! I love this site and I know I'll love the book. Christmas, birthdays, Father's Day 2010  check!

Reply

Rich Bowdry
Rich Bowdry United States
1/15/2016 4:33:55 AM #

the style of keeping you connected with so many things of different types is awesome and you find it interesting everytime.

Reply

Micheline Trafton
Micheline Trafton United States
1/15/2016 4:57:02 AM #

Thaaaat IS awesome! lol hehe

Reply

Francisco Brixner
Francisco Brixner United States
1/15/2016 6:06:29 AM #

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

Reply

Wai Freifeld
Wai Freifeld United States
1/15/2016 6:07:42 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

Micheline Trafton
Micheline Trafton United States
1/15/2016 6:43:18 AM #

Congratulations, Neil! I love this site and I know I'll love the book. Christmas, birthdays, Father's Day 2010  check!

Reply

Betsy Ragans
Betsy Ragans United States
1/15/2016 7:12:00 AM #

getting laid AWSOME

Reply

Jose Bacone
Jose Bacone United States
1/15/2016 7:15:18 AM #

Thaaaat IS awesome! lol hehe

Reply

Thersa Tomich
Thersa Tomich United States
1/15/2016 8:27:47 AM #

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

Reply

Patrica Guccione
Patrica Guccione United States
1/15/2016 8:29:06 AM #

Congrats! This is such a great website, I know it will translate well into book form. Which is AWESOME!

Reply

Dan Geschke
Dan Geschke United States
7/13/2016 4:05:33 AM #

thanx for the post

Reply

webjob
webjob United States
8/29/2016 8:14:05 AM #

I am following often your posts and I noticed that every post contains an informative value. I have benefited from your website in many ways and I suggested this site to my friends.There is no doubt that they will like it.

Reply

James Fly
James Fly United States
9/26/2016 4:10:05 AM #

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

Reply

Angelika Sotak
Angelika Sotak United States
11/11/2016 10:03:53 PM #

Promotion is healthy, because it makes people aware of a product you have. If you have skills in technology such as Objective C, Cocoa, and Xcode, then feel free to develop your app. Do some research on current trends and what your target users want (and don't want!).

Reply

amazing sex videos
amazing sex videos United States
2/6/2017 12:22:54 PM #

Hello! I simply wish to give you a huge thumbs up for your excellent information you have got right here on this post. I will be coming back to your blog for more soon.

Reply

Irving Hibl
Irving Hibl United States
3/27/2017 3:27:32 AM #

This is a awesome website with some great information

Reply

apk downloads
apk downloads United States
4/9/2017 11:17:01 AM #

I have another website may download apk from Google Play: http://www.apksmart.com

Reply

download google play apk free
download google play apk free United States
4/10/2017 7:29:44 PM #

check this site, it also could download apk directly from Google Play: http://www.apksmart.com

Reply

apk downloader
apk downloader United States
4/15/2017 3:22:50 AM #

I have another website may fetch apk from Google Play: http://www.apksmart.com

Reply

download google play apk
download google play apk United States
4/19/2017 1:36:19 PM #

I got another site may download apk from Google Play: http://www.apksmart.com

Reply

remedios caseros para el acne
remedios caseros para el acne United States
10/6/2017 1:33:16 AM #

I relish, cause I discovered exactly what I used to be taking a look for. You've ended my 4 day long hunt! God Bless you man. Have a great day. Bye

Reply

Imelda Vermont
Imelda Vermont United States
5/21/2018 10:04:45 PM #

I can't believe how great this site is. You keep up the good work. That's my advice pal.

Reply

Olin Doren
Olin Doren United States
5/22/2018 5:45:44 PM #

Just fabulous. Who wrote this and how can we get more?

Reply

baexkitty
baexkitty United States
5/22/2018 9:54:38 PM #

She may take her panties off at any time!

Reply

Funny Website
Funny Website United States
5/23/2018 3:17:03 PM #

Have a good laugh at this site.

Reply

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS