Running MSTest Unit Tests

Applies to TestComplete 15.47, last modified on January 20, 2023

MSTest is Microsoft’s tool used to run tests of .NET applications (in particular, it can be used for unit testing). In TestComplete, you can integrate your MSTest tests to your test projects and run them as part of your automated testing process.

In the MSTest editor, you configure the tests to be run.

Requirements
  • To run MSTest unit tests, specify the full path to the MSTest executable (mstest.exe) in the Unit Testing Options dialog.

    To call this dialog directly from the editor, right-click somewhere in the editor and then click Options.

1. Prepare Your MSTest Tests
  • Copy your MSTest test files to your TestComplete computer.

2. Configure Your TestComplete Project
3. Configure the MSTest Item to Run Needed Tests
  • In Assembly file name, specify the name (with the full path) of the assembly file (.exe or .dll) that contains MSTest tests to run. If the needed assembly is registered in the Global Assembly Cache (GAC), you can click Browse GAC and select the assembly from the Browse GAC dialog.

  • If needed, in Configuration file name, specify the fully-qualified name of the test run’s configuration file (typically, .rcg or .testrunconfig. The latter is used for tests created with Visual Studio 2005 or 2008). You can find information on how to manage test configurations and create a test run configuration file in the MSDN Library (the online version is available at http://msdn.microsoft.com).

4. Run the MSTest Item

Run the MSTest item in TestComplete. For information on how to run unit test items, see Running Unit Tests.

After the test run is over, view the test results.

Alternatives to MSTest Unit Tests

Another way to test units of your .NET application in TestComplete is to create unit tests by using TestComplete or the NUnit framework and use TCUnitTest or NUnit test items to run the tests in TestComplete. See TestComplete Unit Tests - .NET Applications and Running NUnit Tests and Selenium Tests Created With NUnit.

See Also

Integration With Unit Testing Frameworks
Running Unit Tests
TestComplete Unit Tests - .NET Applications
Unit Testing Options Dialog

Highlight search results