Code Coverage 0.0% for TSQL Projects(Contains Stored Procedures, Tables, Scripts etc)

Supravat Samanta 21 Reputation points
2021-07-08T10:12:57.7+00:00

We have used MSTest as testing framework for writing all Stored Procedures unit test case for TSQL projects.
Its showing now 0.0% coverage for all Stored Procedures though all are having the valid Unit Test cases. Is it possible to do code coverage for TSQL projects?
The code coverage is working fine for .NET web projects.

Any help will be appreciated.

Developer technologies Visual Studio Testing
Developer technologies Transact-SQL
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2021-07-09T03:04:22.503+00:00

    Hello @Supravat Samanta ,

    Welcome to Microsoft Q&A forum.

    Indeed, MSTest works well with .NET, but for TSQL, did you refer to(follow) this document: How to: Create a Test Project for SQL Server Database Unit Testing? It is a little different from MSTest (.NET).

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful

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.