Naming convention

It is recommended that you choose a consistent naming convention for your tests, as it makes the results a lot easier to analyze. There are a number of approaches used for unit test naming. We will choose a popular naming convention described at http://osherove.com/blog/2005/4/3/naming-standards-for-unit-tests.html. Generally, the naming convention suggests that the unit test name should be comprised of the following:

[UnitOfWork_StateUnderTest_ExpectedBehavior]

Let's explore all the parts of the naming structure:

  • UnitOfWork: This is the unit under test, such as a class or method.
  • StateUnderTest: This is the requirement being tested. For instance, a description of the specific "type" of input parameters provided in this ...

Get Serverless computing in Azure with .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.