Our Black Friday discount is now LIVE! Use code BLACKFRIDAY24 to get 40% off any Course, Bundle or your first year of Dometrain Pro!

From Zero to Hero: Integration testing in ASP.NET Core

Make sure your services are bullet proof

Integration testing has quickly become one of the most used and most important types of testing for modern .NET and ASP.NET Core applications. This is mainly due to how much value a single Integration test can add and how easy it has become nowadays to write Integration Tests due to advancements in tooling. In this course, Nick Chapsas will introduce you to the beautiful world of modern integration testing and how you can ensure that your services behave as expected.

Curriculum

Welcome (1:35)

What will you learn in this course? (2:51)

Who is the course for and prerequisites (1:37)

The types of testing (8:18)

The testing pyramid (3:02)

Why are integration tests so important? (2:19)

Why should you write integration tests? (2:17)

What is in scope for integration testing (3:07)

The project we will be working with (6:40)

The 5 core integration testing steps (2:59)

Project separation (2:39)

Why xUnit? (1:16)

Writing your first integration test (4:51)

Naming in integration tests (2:31)

Arrange, Act, Assert (1:48)

xUnit’s test execution model (3:27)

Test setup (2:04)

Test cleanup (1:53)

Parameterizing tests (5:26)

Ignoring tests (1:18)

Section recap (0:46)

What this section is about (0:31)

Writing fluent assertions (3:19)

Testing strings (2:58)

Testing numbers (2:00)

Testing dates (1:37)

Testing objects (3:32)

Testing enumerables (3:32)

Testing methods that throw Exceptions (2:23)

Testing for raised events (1:29)

Testing private methods (members) (1:24)

Testing internal methods (members) (3:01)

Section recap (0:26)

The problem with integration tests (1:14)

Introducing the WebApplicationFactory (5:06)

Testing status codes (1:58)

Testing text responses (1:31)

Testing JSON responses (1:34)

Testing response headers (1:00)

Creating realistic test data (5:39)

Cleaning up the test data (2:31)

Sharing a single application for multiple test classes (5:32)

Section recap (0:37)

The project we will be writing integration tests for (5:11)

Creating the WebApplicationFactory (3:46)

The problem with data store dependencies (1:19)

Introducing Docker (4:05)

Taking a look at docker compose files (2:49)

Creating a test container for our database (8:04)

The problem with third party API dependencies (1:45)

Introducing WireMock (3:50)

Creating a mocked API server with WireMock (5:57)

Testing: Create a resource (14:39)

Your turn to practice (1:06)

Testing: Getting a resource (4:34)

Testing: Getting all resources (5:05)

Testing: Updating a resource (3:51)

Testing: Deleting resource (1:25)

Testing: API Dependency Is Unavailable (4:36)

Dealing with requests requiring auth (2:12)

Dealing with background services (1:36)

Integration testing Minimal APIs (0:52)

Dealing with Entity Framework (3:10)

Section recap (1:06)

The project we will be writing UI integration tests for (2:15)

What we need to do to test the UI (1:41)

Introducing Playwright (4:12)

How our Docker strategy changes (6:37)

Bootstrapping the test project (7:11)

Testing: Create a resource (14:33)

Testing: Get a resource (6:37)

Your turn to practice (0:48)

Testing: Getting all the resources (3:07)

Testing: Update a resource (5:57)

Testing: Delete a resource (3:46)

Section recap (0:41)

Course conclusion (0:28)

Course Info

Level:
From Zero to Hero
Duration:
4h 14m
Rating (4,5K+):
star

Lifetime access

Add to Cart

Part of the bundle

From Zero to Hero: Testing Essentials Bundle in .NET Bundle thumbnail Get it for 20% off
Dometrain Pro

Want access to all of our courses? Subscribe to Dometrain Pro!

Try it for free!

About the Author

author_img

Nick Chapsas

Nick Chapsas is a .NET & C# content creator, educator and a Microsoft MVP for Developer Technologies with years of experience in Software Engineering and Engineering Management.

He has worked for some of the biggest companies in the world, building systems that served millions of users and tens of thousands of requests per second.

Nick creates free content on YouTube and is the host of the Keep Coding Podcast.

More courses by Nick Chapsas