During the session we had several questions about database unit testing, in particular how to write data driven tests and how to implement mocking support. I mentioned that these were not built-in but that they could be supported by use of T4 templates (for data-driven testing) and use of the TSQLT framework (for mocking support). The blog posts that cover how to set this up are by Steven Wright. The main post is Integrating tsqlt with Team Foundation Build Services continuous buildating-tsqlt-with-team-foundation.html. This covers using T4 templates to generate the necessary database unit test classes (as shown in the demo) so that TSQLT tests can be run as part of Continuous Integration. The same process could be used to automatically output data-driven tests with a little bit of work.
Comments
SQL Server Data Tools for Visual Studio
@Dwain, unfortunately saving table selection is not currently supported in SSDT. Please open a Connect item as that will help us track this request.
@Vikash, as Donovan mentioned you can compare from Database back to Project and this will let you pull in any changes performed by other developers.
Thanks,
Kevin
Application Lifecycle Management for SQL Server Database Development
During the session we had several questions about database unit testing, in particular how to write data driven tests and how to implement mocking support. I mentioned that these were not built-in but that they could be supported by use of T4 templates (for data-driven testing) and use of the TSQLT framework (for mocking support). The blog posts that cover how to set this up are by Steven Wright. The main post is Integrating tsqlt with Team Foundation Build Services continuous buildating-tsqlt-with-team-foundation.html. This covers using T4 templates to generate the necessary database unit test classes (as shown in the demo) so that TSQLT tests can be run as part of Continuous Integration. The same process could be used to automatically output data-driven tests with a little bit of work.