Wojciech Krasa
Workshop
Testing framework with PostgreSQL and Testcontainers for .NET
Speaker's Biography
Wojciech Krasa is a Senior .NET Developer at HeadChannel. He has over 12 years of experience as a developer focused on application development using .NET, and Azure.
He has a wide variety of skills and is always open to learning new things. He is an ABP enthusiast. In his free time, he enjoys cycling, hiking, and playing with his daughter.
Workshop Abstract
Writing tests is usually not the most pleasant thing in the world. In many projects, it is neglected or even avoided. We would like to present an approach that made writing tests slightly more friendly.
We created a small and simple testing framework based on PostgreSQL, Docker, Testcontainers for .NET, and ABP. I will present how the database is created, how the data seeding process works, and how we manage database lifetime (one database per test, multiple databases per docker image).
On top of that, I will describe concepts of UOW and user permissions in tests.
The important part of testing is creating and maintaining our test data, which is reusable and can be shared in multiple tests.
Finally, I will show how to utilize all of that in tests.