Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

My blog has moved.
You can view this post at the following address:
http://www.osherove.com/blog/2004/10/5/introducing-xtunit-an-unofficial-unit-testing-extensibility.html
Published Tuesday, October 05, 2004 7:26 PM by RoyOsherove

Comments

Tuesday, October 05, 2004 11:34 AM by TrackBack

# NUnit Extensibility Framework, OSS Lecture, etc...

Tuesday, October 05, 2004 11:13 PM by Ido Tandy

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

I've just tried it on a REAL project and it works like a charm...
I have Rollback without the need for NunitX...
as always, Roy, you're the king...
right mate ?!
Wednesday, October 06, 2004 12:32 AM by Sean McCormack

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

Awesome stuff...Thanks!
Wednesday, October 06, 2004 9:16 AM by Jonathan de Halleux

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

Hy Roy,

This looks very nice. I'll try it as soon as I get my box back. Would you be interrested in shipping this framework along with TestDriven.NET ? You framework would definitely have his place there :)
Wednesday, October 06, 2004 11:41 AM by Dave Montgomery

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

I echo Jonathan's sentiment. TestDriven.NET all the way.
Wednesday, October 06, 2004 8:03 PM by TrackBack

# And now RoyO is in on the act too...

Wednesday, October 06, 2004 8:04 PM by Mike Gale

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

The distance Unit testing has come inside .NET blows my mind. Those first JUnit ports are especially unimpressive when viewed from the vantage point of today.

Great work Roy and Peli.
Wednesday, October 06, 2004 8:21 PM by Trey Hutcheson

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

Roy,
Way to go dude. Very exciting stuff. I haven't downloaded it yet, but it's definitely on my to-do list. I started to have similar ideas a few days ago after reading the same article on gotdotnet.

Looking forward to playing with it.
trey
Wednesday, October 06, 2004 9:11 PM by Roy Osherove

# re: Introducing: Unofficial NUnit Extensibility Framework - make your own test attributes easily!

Peli (Jonathan): Great idea! This should be a part of TD.Net.
Monday, October 11, 2004 2:37 AM by Assaf K

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

Great idea and implementation.
Also I need your opinion: if I want to add utilities classes to the NUnit freamwork
Like you wrote before (DataComparison etc… remember?) Where shell I add this class? I guess I need to add it to the XtUnit.Extensions.XXX project am I right?
Thanks?
Monday, October 11, 2004 4:17 PM by TrackBack

# Introducing the Osherove.Interception framework

Monday, October 11, 2004 9:05 PM by TrackBack

# Introducing the Osherove.Interception framework

Monday, October 11, 2004 10:25 PM by MarkFocas

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

It appears that this only runs under Win 2003
Tuesday, October 26, 2004 6:03 PM by adult-galleries

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

Thursday, December 09, 2004 1:04 PM by TrackBack

# I changed my mind - Mock objects are wrong for database unit testing

Thursday, December 09, 2004 8:41 PM by TrackBack

# I changed my mind - Mock objects are wrong for database unit testing

Monday, December 20, 2004 4:17 AM by TrackBack

# Summary of Database Unit testing techniques

Saturday, January 22, 2005 11:31 AM by TrackBack

# Database Unit Testing issues and solutions: Rollback And RestoreDatabase abilities

Sunday, January 23, 2005 2:29 AM by TrackBack

# New stuff on Team Agile: XtUnit and Interception block with basic documentation

Wednesday, February 09, 2005 9:36 PM by TrackBack

# FreeDevelopmentTools

Wednesday, February 23, 2005 3:58 PM by TrackBack

# NUint的使用二 [原创]

Ping Back来自:blog.csdn.net
Friday, June 10, 2005 10:37 PM by TrackBack

# re: Rollback Attribute for NUnit 2.2.1 and Above

Saturday, May 27, 2006 6:51 AM by mattonsoftware.com

# .NET Resources

The following links to .NET resources have been collated over time with the assistance of colleagues. ...
Wednesday, May 31, 2006 2:05 AM by ISerializable - Roy Osherove's Blog

# Introducing: NUnitX and the Rollback attribute - Seamless database rollback with Nunit

Update: You may be more interested in XTUnit, which was released a bit later on and provides the same...
Wednesday, June 21, 2006 4:14 PM by ISerializable - Roy Osherove's Blog

# New stuff on Team Agile: XtUnit and Interception block with basic documentation

Update: Fixed broken links (21-6-06)
I just finished adding a new downloads section to the Team Agile...
Monday, July 24, 2006 12:52 PM by Colin Jack

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

I've tried using the using the DataRollbackAttribute but keep getting wierd MSDTC Transaction Errors: http://groups.google.co.uk/group/microsoft.public.dotnet.framework.component_services/browse_thread/thread/ae13b44beda812e5/29b5c9dfc68003fb?lnk=st&q=&rnum=1&hl=en#29b5c9dfc68003fb So far I've found it hard to pin point why I'm getting these problems, though most of the code I'm calling within the unit test uses its own transactions so that must be a factor. Anyway I wondered whether anyone else has met/conquered this problem?
Monday, November 27, 2006 12:59 PM by Peter Fitzgibbons

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

HI Roy,

I'm getting this on my testing solution when I try to use the SampleTestFixture.cs copied into my solution.  This is using TestDriven.net 2.0.1948 Personal :

TestCase 'M:dbTesting.SampleTestFixture.MyDataRelatedTest'

failed: Couldn't find declaring type with name 'dbTesting.SampleTestFixture'

Do you have an idea what's causing this ?

Thanks for your help!

Tuesday, December 19, 2006 9:54 AM by Cosimo Carbonelli

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

Hi, I'm using DataRollBack attribute and it works fine with Sql Server...compliments...but now I want to use it even with an application that uses an Oracle 9i db accessed by ODP.NET . Reading your article, I've thought that it must work anyway, because ODP.NET is based upon ADO.NET . Enterprise Services manages transactions at this level...but it doesn't work, or rather, the transaction doesn't roll back...do you have any idea?

Thursday, December 21, 2006 4:03 AM by Cosimo Carbonelli

# re: Introducing: XtUnit . An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily!

Hi, I've forgot to say that the Oracle server is on a remote machine. This is probably the cause of the problem. Of course XtUnit works on the local DTC...it is possible to connect on the ServiceDomain object of a remote machine? And how to do that?

Thanks for your help

Cosimo

Tuesday, February 20, 2007 1:22 PM by Michael Larkin

# Used TransactionScope instead

I modified the code to use System.Transactions.TransactionScope...thus removing the need for the MSDTC and Enterprise Services.

public class RollBackAttribute:TestProcessingAttributeBase

{

       TransactionScope transactionScope;

[DebuggerStepThrough]

protected override void OnPreProcess()

{

try

{

               transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew, new TimeSpan(0,0,0,10000,0));

}

catch(Exception e)

{

OutputDebugMessage("Could not enter into a new transaction:\n" + e.ToString());    

}

}

       [DebuggerStepThrough]

protected override void OnPostProcess()

{

try

{

               Transaction.Current.Rollback();

               transactionScope.Dispose();              

}

catch(Exception e)

{

OutputDebugMessage("Could not leave an existing transaction:\n" + e.ToString());    

}

}

}