Is it possible to delete all data in a database using NHibernate. I want to do this before the start of each unit test. I am currently deleting my database and creating it again, but this is not an acceptable solution for me.
==================================================== ========
Ok, here are the results. I am testing this in a database (Postgre). I will test the solution of CreateSchema (1), DanP (2) and apollodude217 (3). I run tests 5 times with each method and take average time.
Round 1 - 10 tests
(1) - ~ 26 sec
(2) - 9.0 sec
(3) - 9.3 s
Round 2 - 100 tests
(1) - Come on, I won’t do this on my machine
(2) - 12.6 sec
(3) - 18.6 s
I think there is no need to test with a lot of tests.
source
share