Ideally, you would want to run all tests on the database same as on production, in separate/isolated databases, and quickly on top of it. Luckily, this is easily achievable with PostgreSQL and xUnit and it is one of the reasons I like using the PostgreSQL database. This is what we'll do: Create a base (template) database at the tests startup Create a copy of the template database at the individual
![Creating new PostgreSQL DB for every xUnit test](https://cdn-ak-scissors.b.st-hatena.com/image/square/cad9cc925c114c64fb8cab5f98f0966066535326/height=288;version=1;width=512/https%3A%2F%2Fdev.to%2Fsocial_previews%2Farticle%2F339306.png)