Best Way to Test Against a Database



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.
.



Relevant Pages

  • Re: Bitmap/Image data type
    ... or where exactly you are passing it around. ... Typically an image will be grabbed from a source (could be database, file, ... double clicks it it gets passed to another form to display full screen. ... deleted (or if the user so specifies then my app will delete it)). ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Problem with blank/null DataErr & OpenForm Action cancelled
    ... > The WHERE clause criteria you are passing to the form assumes that the DB ... > adds your question and the answers to the database of answers. ... >> Dim stDocName As String ... >> Tom Wheeler ...
    (microsoft.public.access.formscoding)
  • Re: Pure client-side javscript database?
    ... >> implemented a database with a subset of SQL in pure client-side ... passing down predicitve data can make for a much more usuable interface. ... display only a two hour slice of data... ...
    (comp.lang.javascript)
  • Re: Using a Link Button to redirect to another page by using data from
    ... protected logout as HtmlAnchor ... Sub Page_Load ... the customer id from my database. ... > passing the page emp_id=1 as the argument? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Filter of Report
    ... inadequate method of passing dates to the database and is bound to fail ... the internal conversion methods: ... strBeginningDate = Format(dtBeginning, strJetDates) ... and really read the stuff you are passing to the database first. ...
    (microsoft.public.access.modulesdaovba)