How to use database connection with our Unit testing project. We have some thousands of unit test code that follows NUnit framework for our MVC application. We have lot of business logic codes that connect with SQL database with MVC application. So we have written unit testing codes that apply the same business logic which connect with database.
For example we have written to insert, update, retrieve operation in unit testing which connect to database.
We have two different source one for Local or Staging application, and another Production application. So different database for Local and Production. Now our testing codes are connected with local database. Is this better way to use different database for unit testing codes to run?
Is changing connection string to change different database connection in web config file of Unit testing projection enough and right way to do or else do we have any other proper way to switch database based on different Solution configurations?
Help us the address this scenario.
Regards, Karthik.
Aucun commentaire:
Enregistrer un commentaire