SSDT: how to create and deploy database unit tests

Parvinder Tomar 146 Reputation points
2022-06-20T18:43:40.313+00:00

I have created unit tests in the database project. How do I deploy them? Also, feel free to share if anyone has any documentation on SSDT unit tests.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 20,911 Reputation points Microsoft Employee Moderator
    2022-06-21T21:11:25.947+00:00

    Hi @Parvinder Tomar

    I do not find good documentation on what scenarios we should run the tests and also how to deploy them.

    You create SQL Server unit tests to help identify code defects that might cause incorrect application behavior. For instance, you can create a SQL Server unit test that verifies the behavior of several stored procedures.

    First create a SQL server Unit test then use visual studio to run the tests
    There are few examples and step by step on how that can be achieved Walkthrough: Creating and Running a SQL Server Unit Test
    Then How to: Run SQL Server Unit Tests using Visual studio 2010 and 2012. I am not sure if others version will work.

    I can repo this from my end and let you know

    Regards,
    Oury


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.