re: Why Use PostgreSQL functions for your application development VIEW POST

re: How do you do unit test?

Here is how it works:

On each testing session testing system creates test database (and test user if necessary), then applies all migrations from first to last.

Test database is cleared (dropped) when testing session is done.

On each test new transaction is started and rollbacked when test is finished to ensure proper test isolation.

Before any tests system first inserts test data from fixtures, scripts or generated from factory objects and then performs actual test.

Tests woulčd be more similar to integration full stack tests. Simply issue a request and inspect the results.

Now, there is obviously quite amount of plumbing code here and I'm already working on simple solution that would for .net standard that supports both XUnit and MSTest. -> github.com/vbilopav/postgrest.net

Code of Conduct Report abuse