filmov
tv
The Best Way To Use Docker For Integration Testing In .NET
Показать описание
Integration testing is a testing approach that tests the integration between multiple components. Usually, this will involve a database, so you can test your query logic. Docker is an excellent tool for creating throwaway databases for your integration tests. And you can make it even better with the Testconatiners library. It allows you to programmatically create your docker containers for integration testing.
Testcontainers - Integration Testing Using Docker In .NET
Join my weekly .NET newsletter:
Read my Blog here:
Subscribe for more:
Chapters:
0:00 Creating the test project and installing Testcontainers
1:55 Implementing a custom WebApplicationFactory
6:11 Adding a PostgreSQL container with Testcontainers
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 in the database
16:13 Integration test 3: Getting a product by the ID
Комментарии