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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.