Hi Sasha:
Two thoughts to consider:
Depending on your design you could use an O/R mapper or code
generation tool to spit out code. There are advantages and
disadvantages to this approach, of course, but one of the advantages
is you'll have compile errors if the upper layer code is not keeping
up with the schema changes.
Unit testing code that needs access to the database can be tricky,
using mock objects doesn't solve all the problems of course but it can
remove some dependencies and make testing easier. One approach I've
seen used is to test against the real db, but wrap your test methods
with enterprise transactions, there is a discussion here:
http://weblogs.asp.net/rosherove/art...ittesting.aspx
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Wed, 02 Mar 2005 11:29:04 -0800, Sasha <no*****@noemail.com> wrote:
Hi everybody,
I am starting a new ASP.NET/SQL Server project and this time I want to
do it through Test-Driven Development (TDD). The problem that I ran into
is this: How do you test data access logic with a database in the
backend? I do not want to use mock objects because if the schema changes
I will miss those errors.
If you are using TDD to test data access code, please post the
description of your setup or some pointers and suggestions.
Thank you very much for your help!
Sasha