If you've ever drunk from the test-driven development fountain, it's hard to go back. In my profession, however, I'm not always afforded the freedom to choose how my projects will be developed. As a consultant,
I must be able to adapt to the client's particular environment, be it .Net and SQL Server or Java and Oracle. Recently, I got involved in a .Net-based project building a custom add-on to a legacy system. That legacy system
(and all of its subsequent modifications) was running on SQL Server, with tons and tons of stored procedures. Oh, happy times...
Anyway, having had too much of the TDD Kool-Aid (can I use that here? I betcha it's copyrighted...), I started digging through the various unit-testing tools available. I knew about NUnit,
having worked with it before. However, one thing I found is that there wasn't much in the way of database-testing in the .Net world. Not to say that the Java world's database-centric unit-testing is all that robust, but at least
there's something (see DbUnit and SQLUnit). Dead end.
My next step was to take a look at doing the unit-testing in the database. I was familiar with Steve Feuerstein's utPLSQL library (and it's successor, OUnit).
I assumed I could find something similar focused on T-SQL. I did find tsqlunit, but given the client environment I was in and the library's prerequisites, I didn't feel it was going to fit
the bill. Dead end #2.
Path #3: extending NUnit. I already had NUnit 2.2.8 installed, so I started poking through the documentation and samples, looking at how to extend it. Not much going there; it just didn't seem to work and the documentation was very, very thin.
And then, a breakthrough. I found a thread on the NUnit developers list (an excellent resource, by the way) talking about ExtensionPoints. The thread didn't
indicate a version of NUnit, so I started going through the code, looking for this ExtensionPoint thingamajig. No dice. At least, not until I downloaded the bleeding edge, NUnit 2.4. There, in all its glory, ExtensionPoints. And not only
that, they worked like a champ. All of a sudden I was off and running.
Enjoy. Let me know what you think, etc. Oh, and if you feel like contributing, by all means; just send me an email via sourceforge.
a
Supported Drivers:
- System.Data.Oledb
- System.Data.Odbc
- System.Data.SqlClient
- Oracle.DataAccess.Client 10.2.0.2.20