Hi, 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? Thx Updated at 22.10.2009 17:11:39I 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. Keep walking... This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by mantzas. |
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. mantzas wrote: I see, this means that i have to manually delete and insert data before each test in order to have a common state. This is a workaround, ok ill try that approach(this will be slower than just rolling back any changes). Thx P.S. Note that memory provider currently does not support rollbacks. |