I use SSDT for database development for a while and now I would like to start with database unit tests. I have difficulties with designing unit test project structure that would be optimal for my solution. I would like to get some best practices about unit test projects.
Currently I have a solution which is divided into few folders and each folder contains few database projects. The folders are logical representation for SQL Server instances. I use Bamboo to build the solution in a continuous integration process. Also I would like my test project to be executed by Bamboo after it is built and deployed on a test server.
I have such questions:
- Should I create a separate solution for unit test?
- Should I create a Tests folder in the current solution and put there unit tests project?
- Should I create one unit test project for all databases, or one for a folder, or one for each database, or one for each db object?
- What is the best approach to test complex stored procedures (for example a stored procedure insert or update data in a one or more tables basing on queries from other tables, no result set returned, some updated columns are timestamps and indentites)?
Aucun commentaire:
Enregistrer un commentaire