What is the proper way to nest transaction scopes using UnitOfWork?

I want to wrap integration tests in a transaction scope that I can
rollback after the test completes.  But I still want to be able to use
transactions in my tests.

I want something like this:

<code>
[TestInitalize]
public void TestInit() {
    // create transaction scope
}

[TestCleanup]
public void TestCleanup() {
    // rollback changes from test
}

[TestMethod]
public void Test() {
    using (UnitOfWork.Start()) {
        // start transaction in new scope

        // logic

        // commit transaction

        // test changes
    }
}
</code>

I've seen that UnitOfWork is nestable, but I don't know how that
affects sessions and transactions.

Any help or clarification would be appreciated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to