Unit testing approach

A common approach to writing tests can be called AAA, which stands for Arrange -> Act -> Assert. With this approach, each test case is structured as follows:

  • Arrange: This section of the test initializes the objects, variables, and mocks, and sets the data passed to the unit under test
  • Act: This section invokes the unit under test with the arranged parameters
  • Assert: This section verifies that the unit under test behaved as expected

To learn more about Arrange/Act/Assert pattern, please visit https://msdn.microsoft.com/en-us/library/hh694602.aspx#Write your tests

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.