i am using mbunit (gallio) mainly because it supports "[Rollback]" attribute in order to get the database in the previous state again. In my other projects it worked like a charm. With DO4 it does not work . Has this something to do with nested transactions that you do not support. Is there another way of doing this without delete and insert data before every test?
Updated at 22.10.2009 17:11:39
I used a different approach.
Created 2 stored procs that dele and insert all data. Working very well.
I have enums that i persist in the db. any other process maybe mess up that enumeration.
Working with sql server and not the memory is more close to the actual application.
Thank you for your advice.
This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by mantzas.
asked Oct 20 '09 at 20:38
If I understood this properly:
So speaking about DO4:
Few examples of using Setup/TearDown:
You can rollback the state, but not with "memory://". Although if you will commit something, you won't be able to roll it back.
Concerning memory:// & tests in general:
So in general, recreating the storage might work well.
Another option is to make all the tests leaving storage in "testable" state - i.e. a state that allow other (or further - normally they're sequenced) tests to pass properly. Normally we use this approach. If this won't work for some test fixture, ensure it resets the state on start.
answered Oct 20 '09 at 21:34