Naming your Tests according to .net best practices

“The beginning of wisdom is to call things by their proper name.”

  • Ancient Chinese Proverb

Let us put this adage into practice by calling our Nunit tests appropriately.

  1. Create a project, (class library) and name it: ProjectName.Tests . (Obviously you will need to substitute the name of your project the above. So if my project was called: VREarth then my new class project should be called: VREarth.Tests.
  2. Create classes in the project with this structure: ClassNameTests.
  3. For each method in the above class, use this naming system: [MethodName][StateUnderTest][ExpectedBehaviour]

Source: The Art of Unit Testing. Commonly expected practice.

Written on November 30, 2016