Integration tests problems

time to read 1 min | 184 words

I have run into an interesting problem today. I want to build a set of integration tests that exercise my UI. The problem is that I want my integration tests to:

  • Talk to a test DB
  • Setup all the data on their own
  • Invoke the UI to do operation on the data they just entered.
  • Verify the results
  • Be debuggable

This basically means that for the duration of the unit test, I need to modify the connection string for the web site. The problem is that I need to restore it after the tests have run, which bring about the issue of failing tests and what state they would leave the site.

Any ideas how to solve this problem?