Unit Testing an ASP.NET Core 6 Web API

by Kevin Dockx

Unit testing your ASP.NET Core 6 Web API helps with improving its reliability. This course will teach you the ins and outs of unit testing with xUnit in detail.

What you'll learn

Unit testing improves the reliability of your application. In this course, Unit Testing an ASP.NET Core 6 Web API, you’ll learn the ins and outs of unit testing with xUnit.net.

First, you’ll explore the arrange, act, and assert pattern by covering core unit testing scenarios like asserting on strings, collections, and exceptions. Next, you’ll discover different approaches to set up your test context, work with data-driven tests, and how to isolate tests.

Finally, you’ll learn different approaches to testing API-specific concerns like testing controllers, middleware, and filters. At the end of the course, you’ll learn how to integrate testing in your workflow.

When you’re finished with this course, you’ll have the skills and knowledge needed to improve your application reliability with unit testing.

Table of contents

Course Overview
2mins

About the author

Kevin Dockx is a freelance solution architect, author & consultant, living in Antwerp (Belgium). He's mainly focused on solution/application architectures & security for web-based (API) applications built with .NET, but he also keeps an eye out for new developments concerning other products from the .NET stack. He's a Microsoft MVP and board member of the RD MS Community. He's also a regular speaker at various (inter)national conferences & user group events, and works on various open source pro... more

Ready to upskill? Get started