Master ASP.NET Core Integration Testing: Learn How TestContainers and WebApplicationFactory Can Help

Foad Alavi
Foad Alavi
8.8 هزار بار بازدید - پارسال - In this video, we dive
In this video, we dive into the world of integration testing for ASP.NET Core WebAPI against a database using WebApplicationFactory and TestContainers.

Buy me a coffee: https://buymeacoffee.com/foadalavix
Patreon: Patreon: FoadAlaviYoutube


⏱️⏱️VIDEO CHAPTERS⏱️⏱️
00:00 - Intro
00:13 - Microsoft documentation
01:37 - Test Server with TestApplicationFactory
19:30 - IClassFixture
21:46 - Test Environment
23:13 -  IAsyncLifetime
24:16 -  Bogus to fake data
32:34 - TestContainers

🔔 Subscribe for more tips just like this: https://www.seevid.ir/c/Foad_Alavi?s...


Throughout the video, we explore the utilization of the WebApplicationFactory to effectively run a test server and demonstrate the implementation of dependency injection for utilizing an in-memory database. We also discuss the importance of testing a database in a test environment and delve into the benefits of Docker-based testing with TestContainers, eliminating the need for a dedicated test environment.
Furthermore, we cover the utilization of the IClassFixture interface to seamlessly share the test context between methods within a test class and demonstrate how to manage the lifecycle of a test using IAsyncLifetime.
To enhance the authenticity of the data used, we showcase the implementation of bogus, a powerful tool for generating meaningful fake data.
Join us as we provide step-by-step guidance on mastering ASP.NET integration testing, leveraging the capabilities of TestContainers and Web Application Factory. Improve your understanding of integration testing and optimize the reliability and efficiency of your ASP.NET Core WebAPI using xUnit.


GitHub Repo: https://github.com/foadalavi/Test-Fou...


All About Testing Playlist: All About Testing


#testing  #csharp #dotnet #integrationtesting  #TestContainer #webapi
پارسال در تاریخ 1402/02/29 منتشر شده است.
8,899 بـار بازدید شده
... بیشتر