Share via


Custom Test Conditions for SQL Server Unit Tests

 

You can add custom test conditions for SQL Server unit tests. However, you must first install the test condition before you can use it, whether you created the extension or you are installing one that someone else created.

Before you install a test condition that you did not create, you should understand the following risks:

  • The installation program for the test condition might be malicious and gain access to protected resources based on your installation permissions.

  • The test condition itself might be malicious and gain control of protected resources if the user who uses the extension has sufficient permissions.

To minimize risk, you should install a custom test condition only if it is from a known source. If you obtain a test condition from an untrusted source, you should inspect the source code for that test condition and its installation program (if it has one) before you install and it.

To install a custom test condition, copy the signed assembly (.dll) to the %Program Files%\Microsoft Visual Studio <Version>\Common7\IDE\Extensions\Microsoft\SQLDB\TestConditions folder. If this folder does not exist, create it. You need administrative privileges on your machine to copy to this directory.

Note

You need to install Visual Studio 2010 and Visual Studio 2012 versions of the test condition if,

  • You install custom test conditions on a computer that may be used to build SQL Server unit tests.

  • Those unit tests are used in Visual Studio 2010 and Visual Studio 2012.

For more information about custom test conditions for SQL Server unit tests, see:

See Also

Verifying Database Code by Using SQL Server Unit Tests