views:

338

answers:

3

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?

+3  A: 

I think your test fixture needs to extend ExtensibleFixture, not InterceptableObject. In the XtUnit source, ExtensibleFixture itself inherits from InterceptableObject. The comments in ExtensibleFixture.cs state:

This is the base class for all the test fixtures you will
have in your project. You MUST inherit from this in order
for the custom attributes to work. No other special action is needed.

tlianza
A: 

Database and your program must be run under WindowsXP SP2 oder Server 2003.

Zhenya
A: 

tlianza is right

Kinderchocolate