May 24, 2008 / software ~ squilbo
Plug data into your NUnit tests

Today I found a cool feature in NUnit 2.5 Alpha 2 that I've been REALLY wanting. Basically, I wanted to be able to run tests multiple times, but with different data each time. This is now possible using the DataSource attribute.

In the case of Squilbo (a database query tool), each test is run once for each database engine the product supports. This is great, I only write the tests once and then run them against each database engine to make sure the features work universally. When I add support for Oracle, I can change one line of code and the tests will be run 3 times.

Image of Squilbo Unit Tests

You may also like...