Best Way to Test Against a Database
- From: "jehugaleahsa@xxxxxxxxx" <jehugaleahsa@xxxxxxxxx>
- Date: Tue, 13 May 2008 11:56:21 -0700 (PDT)
Hello:
What is the best way to test my methods that hit a database?
I believe tests should be as automated as possible. However, I'm not
sure how I can test against a database since changes will modify the
(development) database.
I really don't care whether my SQL does what it's supposed to do, just
that I have my CommandText, CommandType and Parameters set up
correctly.
For instance, I am currently testing my SELECT statements by passing a
bogus primary key. I am thinking I can test my INSERTs and DELETEs
together. Then I can test my update by passing a bogus primary key
again.
However, this seems dirty. I just wanted to see how others have
handled this in past. Any suggestions would be appreciated.
Thanks,
Travis
P.S. - Not that it should make a difference, but I'm using Team Tester.
.
- Follow-Ups:
- RE: Best Way to Test Against a Database
- From: Ethan Strauss
- Re: Best Way to Test Against a Database
- From: Andy
- Re: Best Way to Test Against a Database
- From: Michael Justin
- RE: Best Way to Test Against a Database
- Prev by Date: Re: How to add headers an existing xls file
- Next by Date: Re: Not to draw when my custom control is not visible.
- Previous by thread: How to fill a generics List with reflection?
- Next by thread: Re: Best Way to Test Against a Database
- Index(es):
Relevant Pages
|