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.
The types of testing
The testing pyramid
Why are integration tests so important?
Why should you write integration tests?
What is in scope for integration testing
The project we will be working with
The 5 core integration testing steps
Project separation
Why xUnit?
Writing your first integration test
Naming in integration tests
Arrange, Act, Assert
xUnit’s test execution model
Test setup
Test cleanup
Parameterizing tests
Ignoring tests
Section recap
What this section is about
Writing fluent assertions
Testing strings
Testing numbers
Testing dates
Testing objects
Testing enumerables
Testing methods that throw Exceptions
Testing for raised events
Testing private methods (members)
Testing internal methods (members)
Section recap
The problem with integration tests
Introducing the WebApplicationFactory
Testing status codes
Testing text responses
Testing JSON responses
Testing response headers
Creating realistic test data
Cleaning up the test data
Sharing a single application for multiple test classes
Section recap
The project we will be writing integration tests for
Creating the WebApplicationFactory
The problem with data store dependencies
Introducing Docker
Taking a look at docker compose files
Creating a test container for our database
The problem with third party API dependencies
Introducing WireMock
Creating a mocked API server with WireMock
Testing: Create a resource
Your turn to practice
Testing: Getting a resource
Testing: Getting all resources
Testing: Updating a resource
Testing: Deleting resource
Testing: API Dependency Is Unavailable
Dealing with requests requiring auth
Dealing with background services
Integration testing Minimal APIs
Dealing with Entity Framework
Section recap
The project we will be writing UI integration tests for
What we need to do to test the UI
Introducing Playwright
How our Docker strategy changes
Bootstrapping the test project
Testing: Create a resource
Testing: Get a resource
Your turn to practice
Testing: Getting all the resources
Testing: Update a resource
Testing: Delete a resource
Section recap
Course conclusion
Course Info
Lifetime access
Buy Course
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© 2023 Dometrain. All rights reserved.