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?
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?