andreas.schlapsi

RowTests With NUnit 2.4

I had some time last week and therefore I played around with the new extensibility features of NUnit 2.4. I wanted to know, how difficult it is to implement the RowTest feature of MbUnit as NUnit Addin. Two hours later the RowTest Extension for NUnit was ready. I released the extension under the MIT license. The following code snippet shows you how to use the extension:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[TestFixture]
public class RowTestSample
{
     [RowTest]
     [Row( 1000, 10, 100.0000)]
     [Row(-1000, 10, -100.0000)]
     [Row( 1000, 7, 142.85715)]
     [Row( 1000, 0.00001, 100000000)]
     [Row(4195835, 3145729, 1.3338196)]
     public void DivisionTest(double num, double den, double res)
     {
        Assert.AreEqual(res, num / den, 0.00001);
     }
}

The current release does not support all features of MbUnit RowTests, e.g. Exceptions cannot be tested.

Comments