Resharper complaining about under score methods in test projects
c#, resharper, testing, visual-studio
Solution
Go to Resharper->Options->Code Editing->C#->C# Naming Style
Then click Advanced Settings
Then click Add new rule
Search for Test Type and Test Method and define it to UpperCase_UnderscoreTolerant and uncheck Enable inspections option
For more detailed information please consider visiting:
- Configure a naming style for predefined entities
- How to get Resharper to allow underscores in method names but only in Tests?
- How to change the ReSharper naming style for test methods
Problem
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.