What to cover

It is difficult to determine all the recommended test cases for a unit. One approach aims to cover every single execution path. Another is to test for success, failure, and known edge cases, with most of the tests focusing on failure and edge cases.

A unit is expected to perform successfully when its inputs are valid, and its dependencies perform successfully. A single test can often be sufficient to test the unit behavior under the success conditions.

A unit is expected to fail (gracefully) when its inputs are invalid, or its dependencies are failing. Multiple failures can occur separately or in combination, and thus, multiple test cases may be required.

An edge case is a situation that occurs at an extreme (maximum or minimum) ...

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.