Skip to content
0:00 / 0:00

#respawn#dotnet#integrationtesting

The BEST way to reset your database for testing in .NET

Nick Chapsas

429K subscribers • 62 videos on Hallway

YouTube

Intermediate. Assumes working knowledge.

68K views4 years ago2 recommendations

Tools and practiceDatabases and dataTestingSQL

Nick Chapsas demonstrates how to use the Respawn library to quickly reset database state between integration test runs 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 what I think is the best way to reset your database to a clean state, every time you run a test. This works great with integration testing but other forms of testing can use the same technique. Give Respawn a star on GitHub: github.com/jbogard/Respawn Workshops NDC Minnesota | 15 – 18 Nov | bit.ly/ndcminnesota2022workshop NDC London | 23-27 January 2023 | bit.ly/ndclondon2023 NDC Oslo | 22-26 May 2023 | bit.ly/ndcoslo2023workshop 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 an effective technique for resetting database state to ensure clean, reliable integration tests in .NET.

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/Bergmiesterin r/dotnet • Recommends

On “Testing EF 6+ in Production”

Here is a good video on the topic: link to this video