© Les Jackson 2020
L. JacksonThe Complete ASP.NET Core 3 API Tutorialhttps://doi.org/10.1007/978-1-4842-6255-9_11

11. Unit Testing Our API

Les Jackson1 
(1)
Melbourne, VIC, Australia
 

Chapter Summary

In this chapter we’ll introduce you to Unit Testing, what it is, and why you’d use it. We’ll then create unit tests to test the core functionality of our API Controller, providing us with an automated regression suite (don’t worry if you don’t know what that means!).

When Done, You Will

  • Understand what Unit Testing is and why you should use it.

  • Understand the power of the Repository Interface once again!

  • Understand how to use a mocking or isolation framework in unit testing.

  • Write Unit Tests using xUnit to test our API functionality.

What Is Unit Testing

Probably ...

Get The Complete ASP.NET Core 3 API Tutorial: Hands-On Building, Testing, and Deploying 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.