© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
12 replies
Raso

Issue with xUnit and Integration Test

Hello everyone, I'm trying to do my first tests inside my template. I have already done Unit tests, mocking the dependencies, now I wanted to do some Integration tests to test the minimal apis flow, if they work as expected.
For this test project I'm using Testcontainers.PostgreSql which allow me to use a docker container to run database, and I'm using xUnit for the tests.
Said so, I'm having a small issue:
I know that tests shouldn't depend one from another, but let's say I need to test those minimal apis which have all the CRUD, included the DeleteAll. I need those tests to run with a certain order, because if DeleteAll for some reason ends before the GetAll, the GetAll test will not find anything inside the database. So I need DeleteAll to run as last one.
What do you think about that? What's your approach for this problem? And how can I actually implement an order in xUnit?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Integration testing with testcontainers and cosmosdb
C#CC# / help
2y ago
Unit Test, TestInitialize alternative in xUnit
C#CC# / help
12mo ago
✅ Xunit v3 running test cases in parallel
C#CC# / help
4mo ago
xUnit and Dependency Injection
C#CC# / help
15mo ago