Today I ran XtUnit at a part of my unit testing framework to to rollback database changes created while running a test case. This is a skeleton of how I have used it. The Test case ran successfully but the database state changed as a result.
using NUnit.Framework; using TeamAgile.ApplicationBlocks.Interception; using TeamAgile.ApplicationBlocks.Interception.UnitTestExtensions; namespace NameSpace.UnitTest { [TestFixture] public class Test : InterceptableObject { [Test] [DataRollBack] public void CreateTest() {
I use Nhibernate with Mysql. Am I missing something?
I think your test fixture needs to extend
ExtensibleFixture, notInterceptableObject. In the XtUnit source,ExtensibleFixtureitself inherits fromInterceptableObject. The comments in ExtensibleFixture.cs state: