NUnit Gets MBUnit's RowTest - Test-Driven Development and Unit Testing Excitement
by David Hayden ( Florida ASP.NET Developer ), Filed: Unit Testing
I am a huge fan of MbUnit's RowTest, which allows you to parameterize a unit test and run it for multiple values. This essentially saves you from having to write several boring unit tests to test the same functionality using different values. Anything to get out of writing one less unit test :)
NUnit has never had the RowTest Functionality, which has been a real downer when I needed to use NUnit. However, Jamie Cansdale recently blogged that there is an NUnit AddIn developed by Andreas Schlapsi, called RowTest Extension for NUnit, that provides RowTest Functionality to NUnit. Wow! I needed that a long time ago.
Today I added the RowTest Extension for NUnit by creating a new addins folder within the NUnit directory and adding the NUnitExtension.RowTest.AddIn.dll to the folder:

Reference the assembly, NUnitExtension.RowTest.dll, in your test project and appreciate the wonders of RowTest Functionality in your NUnit Tests:
[RowTest]
[Row(1, 2, 3)]
[Row(3, 4, 7)]
public void CanAddProperly(int a, int b, int c)
{
Assert.AreEqual(a + b, c);
}
Learn more about the NUnit RowTest Extension here.
Cool Stuff!
Recent Unit Testing Related Posts
News Feed: David Hayden ( Florida ASP.NET Developer )
Filed: Unit Testing