More on testing—fixtures
Before we move on to adding more functionality into our TrackStar application, we need to briefly revisit our testing configuration. As we previously discussed, our unit tests actually added new projects to our application in our development environment. Also, even after we completed our tests by deleting the row we created, the database will reuse that same project identifier on subsequent inserts. So, as we continue to run our tests, we will notice gaps in our project ID sequence (which could be confusing during normal development).
The problem is that the unit tests are run against the same database that the web form uses when creating new projects. As a result, there is potential for some issues to arise. What we need to do is to configure our tests to run against a separate, mirrored database, that is dedicated just to testing. What we also need is a way to ensure that our tests are always run in the same manner, against the same data. The former is an easy change...