5 users responded in this post

Subscribe to this post comment rss or trackback url
User Gravatar
Anonymous said in September 21st, 2007 at 3:35 pm

OMG!!!

User Gravatar
Oleg Sych said in September 22nd, 2007 at 7:17 pm

I could think of some problems such a useless unit test would help to detect, having been bitten by one just a few days ago. Somebody mistakenly renamed a stored proc in DAL. No big deal, but the problem went undetected for a while.

User Gravatar
Roy Lawson said in September 23rd, 2007 at 12:42 am

I would be OK with these unit tests if they were generated – many orm generators (nettiers for one) generate unit tests for the DAL.

But, given that the DAL is often a moving target I wouldn’t want to manually create and update these unit tests. It’s more trouble than it’s worth. Your time would be better spent unit testing the business logic.

User Gravatar
Jeff Odell said in November 1st, 2007 at 12:19 am

I would argue this is an Integration Test, not a Unit Test. Hope I didn’t write it!

User Gravatar
Richard said in March 3rd, 2008 at 7:53 pm

This unit test should be testing the DAL based of the code shown. What you are describing "testing business logic" should be a separate unit test. This unit test has many advantages such as testing the SQL or Stored Procedure that were associated with this call, Verifying that the code can still reach the server, Verifying the code still has permissions to preform the action in question, etc…

The business logic code isn’t suppose to sit in the DAL so this test by nature doesn’t focus on business logic. If you search around there is probably another test somewhere that test against business logic and leaves the DAL out of the equation.

Leave A Reply

 Username (Required)

 Email Address (Remains Private)

 Website (Optional)