Unit test tools organized and named correctly

I am trying to clear naming conventions and organize unit tests and integrate our projects. We use C #, NUnit, Visual Studio and Resharper.

It seems like if unit test organization is one of the best practices, then the layout and naming of test classes and namespaces should reflect those that are in the code under test. As a result, the file structure will also be replicated.

Would it be nice to have a tool that could automatically enforce and assist refactoring in accordance with these conventions? Is there such a tool?

For example, it would be easy for Resharper to recognize that OrderTest is a test fixture for the Order class. It can then guarantee that the Order class exists and that it is in the same namespace. If the Order class has been refactored and renamed, the OrderTest class must also be renamed.

+4
source share
3 answers

I also often wanted this. I looked at the Resharper error tracker and found a request to improve this problem. It is planned for Resharper 5.0. Here is his description: http://www.jetbrains.net/jira/browse/RSRP-64050 .

Regarding naming and organizing unit tests, standards change quite a bit, especially with some of the bdd styles that appear. Here's a good article about this naming style. I believe that it is best to use tools to allow the team to adapt and create their own standards. When sharing code, after a while there should be only one standard.

+3
source

We are currently testing Test01, Test02, Test03, etc. It looks like a steering wheel in pirate pants.

I prefer, and I move on to this style of names: Behavioral development: as human as possible

0
source

In fact, ReSharper 4.5 has named styles that will warn you if you don’t follow the naming conventions you set. A few days ago I wrote about this.

If you are interested, follow this link: http://vkreynin.wordpress.com/2009/04/09/resharper-45-complains-about-my-private-fields/ .

0
source

All Articles