Unit-testing with xUnit and TestContainers

Some things are hard to test. Executing Stored procedures with EntityFrameworkCore for example. Stored procedures don’t work with an in-memory dbContext or with Sqlite. To test it, you’ll need a running instance of SQL Server.

Testing with dependencies on infrastructure is not ideal because it requires configuration to be similar across development machines and build agents. Containerizing the infrastructure with Docker can ease the pain.

And then there’s the issue of unit testing in general. A proper unit test has some important…



dotnet/Azure consultant

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store