visual studio - Unit testing a Data Access Layer -


I am reading on a Project Data Access Layer Check Unit. Boil down for most options:

  • Use a dedicated test database, but cleaning (or manually doing) in the final form of all unit tests
  • Duplicate the database

We used rollback in a previous project but I should know more about other options and how These are the best performers if you have sampling / articles / video ... so please share them.

You can test type unit testing and integration testing with 2 projects.

Unit test data tests one aspect of your project without access to data and the presentation. For unit tests you can use your database and user dependency injection so that your code can be unwanted from the data provider. It leads to a better architecture and can be plugged into a different data provider if you wish. Like going from an AdiNet to Anihiberate

There are integration tests where you test your entire system and make sure that your code gets the correct data from the database. There should be a copy of each developer for integration testing at the database of their workstation which they can test, you should try to build your database and automate the population so that you can quickly and easily get back to the good copy of the database. . Tools you like and help you script your database creation.

I will not use a central database to test because other developers can test at the same time and this is not a good state and you can be false positive and try to debug a problem Those who can spend the ages can not have problems.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -