Skip to content
0:00 / 0:00

#testcontainers#dotnet#docker

The cleanest way to use Docker for testing in .NET

Nick Chapsas

429K subscribers • 62 videos on Hallway

YouTube

Intermediate. Assumes working knowledge.

98K views4 years ago2 recommendations

Tools and practiceDatabases and dataTestingDocker and containers

Nick Chapsas shows how to use Testcontainers to spin up and tear down Docker containers for integration testing in .NET.

Check out my courses: dometrain.com Become a Patreon and get source code access: patreon.com/nickchapsas Hello everybody I'm Nick and in this video I will show you how you can quicly spin up and tear down docker containers specific to your test executions. This is only a fraction of what I show in my Integration Testing course so if you want to learn even more cool topics like this check nickchapsas.com out. Workshops NDC Oslo | 26 – 30 Sept | bit.ly/ndcoslo2022workshop NDC Sydney | 10 – 14 Oct | bit.ly/ndcsydney2022workshop dotnetdays | 20 – 22 Oct | bit.ly/dotnetdays2022workshop NDC Minnesota | 15 – 18 Nov | bit.ly/ndcminnesota2022workshop NDC London | 23-27 January 2023 | bit.ly/ndclondon2023 Give TestContainers a star on GitHub: github.com/testcontainers/testcontainers-dotnet Don't forget to comment, like and subscribe :) Social Media: Follow me on GitHub: bit.ly/ChapsasGitHub Follow me on Twitter: bit.ly/ChapsasTwitter Connect on LinkedIn: bit.ly/ChapsasLinkedIn Keep coding merch: keepcoding.shop #csharp #dotnet #testing

Why it's here

2 people recommend this

What people say. Recommended as a great guide on using Testcontainers to easily spin up real database instances for .NET integration tests.

u/zaibufin r/dotnet • Recommends

On “Unit Testing”

You can watch these two by Nick: The cleanest way to use Docker for testing in .NET The BEST way to reset your database for testing in .NET If you want a full course I can recommend his course From Zero to Hero: Integration testing in ASP.NET Core, it's paid but money well spent. I recommend using TestContainers for dotnet. Very easy to spin up any database for your test suite and then dispose it after the test run is done.

u/young_horheyin r/dotnet • Recommends

On “Is this good test practice?”

I would recommend Testcontainers, it’s a library that lets you easily spin up docker containers from your test code. It effectively lets you create an “in-memory” database instance using the real thing, so you don’t have to worry about those testing quirks that you’ve mentioned. Nick Chapsas has a great video on how to use it. link to this video