The best way to use Docker for integration testing in .NET

The best way to use Docker for integration testing in .NET

HomeMilan JovanovićThe best way to use Docker for integration testing in .NET
The best way to use Docker for integration testing in .NET
ChannelPublish DateThumbnail & View CountDownload Video
Channel AvatarPublish Date not found Thumbnail
0 Views
Get the source code for this video for FREE https://the-dotnet-weekly.ck.page/testcontainers
️ Master the modular monolith architecture: https://bit.ly/3SXlzSt
Accelerate your Clean Architecture knowledge: https://bit.ly/3PupkOJ
Support me on Patreon to access the source code: https://www.patreon.com/milanjovanovic

Integration testing is a testing technique that tests the integration between multiple components. It usually uses a database so that you can test your query logic. Docker is a great tool for creating disposable databases for your integration tests. And you can do even better with the Testconatiners library. It allows you to programmatically create your Docker containers for integration testing.

Test containers – integration tests with Docker in .NET
https://www.milanjovanovic.tech/blog/testcontainers-integration-testing-using-docker-in-dotnet

Subscribe to my weekly .NET newsletter:
https://www.milanjovanovic.tech

Read my blog here:
https://www.milanjovanovic.tech/blog

Subscribe for more:
https://www.youtube.com/@MilanJovanovicTech

Chapter:
0:00 Create test project and install test container
1:55 Implementing a custom WebApplicationFactory
6:11 Adding a PostgreSQL container with test containers
8:15 Creating the base integration test class
9:57 Integration Test 1: Creating a Product with Exception
13:10 Integration test 2: Creating a product and validating it in the database
16:13 Integration test 3: Retrieve a product by ID

Please take the opportunity to connect with your friends and family and share this video with them if you find it useful.