Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper complaining about under score methods in test projects

I am working with visual studio 2012 and Reshaper 7.1.1 and have behaviour that really bugs me.

I like to name my C# unit tests like following

public void Identifier_Created_As_Expected()

I feel its a nice way to be able to quickly ready what the test does etc.

Problem I have is that Reshaper complains and gives a warning saying method doesnt match rule etc. Which is correct as such as I would not name my normal methods like this.

Is there any way for my test projects not to get resharper not complain about this an allow it? While not allowing it the normal class libraries.

like image 374
amateur Avatar asked Jan 03 '13 23:01

amateur


1 Answers

Go to Resharper->Options->Code Editing->C#->C# Naming Style

Then click Advanced Settings Advanced Settings is hightlighed

Then click Add new rule Add button is hightlighed

Search for Test Type and Test Method and define it to UpperCase_UnderscoreTolerant and uncheck Enable inspections option Test Method naming rule definition

For more detailed information please consider visiting:

like image 92
Ilya Ivanov Avatar answered Oct 22 '22 09:10

Ilya Ivanov