Brendan Tompkins

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Auto Generate NUnit Tests for Your SQL Sprocs!

Now that I'm on our “SQL Team” (kinda scary isn't it) I'm trying to implement some semblance of unit testing and source control for our SQL stored procedures.  I just downloaded a copy of ApexSQL Edit and have been playing around with it.  I right clicked on a stored procedure, and there was this beautiful little menu choice:

So I click on it, and low and behold, it generated good ol' NUnit test harness code!  You can even add conditionals and manage your tests through the UI.  Very cool indeed. 

Update.  Very buggy indeed, not sure I can recommend the current version for purchase but still cool.

-Brendan


Posted Mon, Nov 22 2004 12:12 PM by Brendan Tompkins

[Advertisement]

Comments

Darrell wrote re: Auto Generate NUnit Tests for Your SQL Sprocs!
on Tue, Nov 23 2004 3:12 AM
I was thinking about developing some sort of SqlUnit (if the name isn't already taken) for testing stored procs etc. through ADO.NET. But then I ended up just testing my sprocs and what-not through my DAL. Probably not the best programming practice... :(
Brendan Tompkins wrote re: Auto Generate NUnit Tests for Your SQL Sprocs!
on Tue, Nov 23 2004 3:54 AM
This is a good question. Do you need tests for your data tier. I think tests for procs are good idea, because other teams can run them as they make changes to sql. But, if you're testing your business tier, do you even want to have separate testing for your dal? Do you care?
William D. Bartholomew wrote re: Auto Generate NUnit Tests for Your SQL Sprocs!
on Tue, Nov 23 2004 1:45 PM
There is something called TSqlUnit floating around (I believe MSDN recently published an article about it in the magazine). Worth a look if you want to just test the stored procedures and not ADO .NET/DAL as well.
s wrote re: Auto Generate NUnit Tests for Your SQL Sprocs!
on Thu, Jun 15 2006 6:52 AM
s
Hbdmpoaz wrote re: Auto Generate NUnit Tests for Your SQL Sprocs!
on Tue, Jul 14 2009 7:43 PM

35J2eq

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us