DataRollBack with XtUnit in Nunit

Today I ran XtUnit on a portion of my unit test environment to roll back the database changes generated when the test case was run. This is the skeleton as I used it. The test case ran successfully, but the state of the database 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 am using Nhibernate with Mysql. Did I miss something?

0


source to share


2 answers


I think your test equipment needs to be expanded ExtensibleFixture

, not InterceptableObject

. In source, XtUnit ExtensibleFixture

itself inherits from InterceptableObject

. Comments in ExtensibleFixture.cs:



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

+3


source


The database and your program must run under WindowsXP SP2 or Server 2003.



0


source







All Articles