Questions tagged [mstest]

Microsoft .NET Unit Testing Framework (MSTest)

Microsoft .NET Unit Testing Framework - MSTest to integrate unit testing (also load testing, coded UI testing, etc.) into Visual Studio.

MSTestv2 contains a command-line utility that helps you run automated tests. You can run all or specific tests contained in a test assembly or event categorize them by:

  • Test Categories
  • Test Type
  • Test Lists

It also has an option to publish the test results in a Team Project on Tfs.

3252 questions
2
votes
3 answers

All MSTest Tests being ignored

I have a visual studio 2013 with resharper 8.1 installed. Out of nowhere all the unittests started being ignored, with no stack message at all. I´ve already, restarted VS, PC, and even uninstalled resharper. Any thoughts? Is there any log file…
2
votes
1 answer

How to substitute config file in test environment?

I am using MSTest to test an application. The test requires certain specific values, which are not normally present, to appear in the application config file. So I need to substitute a well-known config file containing the values, at test run time,…
haughtonomous
  • 4,602
  • 11
  • 34
  • 52
2
votes
0 answers

MTM references assemblies from wrong GAC

A collection of tests fail, because MTM attempts to reference assemblies loaded in the 2.0 Assembly GAC instead of the 4.0 GAC. Each of the test pass when executed using mstest. Is there a technique for forcing MTM to reference the 4.0 Assembly GAC?
bartonm
  • 1,600
  • 3
  • 18
  • 30
2
votes
2 answers

Msbuild copy and flatten with unique file names

I'm trying to copy multiple files from a deep source tree that have the same file name. For example TestResults.trx. I want to copy them into a single directory (i.e. flattened). Problem is they just overwrite each other and I just end up with a…
Keith
  • 785
  • 1
  • 8
  • 20
2
votes
2 answers

VB.Net: how can I get the source path of the assembly while running MSTest?

I'm trying to switch from NUnit to MSTest (for the Code Coverage option). We have some of the configuration for the application stored in files (the application finds them by using a relative path, starting from the "bin" folder, where the .dlls…
user249380
  • 21
  • 2
2
votes
0 answers

MS-Tests: How to maintain test-setting across different dev-environments?

I am setting up a solution that is used by multiple developers/ teams that are working on different features of the next release of an application. In my IntegrationTest-project I need to maintain the test-setting for the different teams. Basically…
thuld
  • 680
  • 3
  • 10
  • 29
2
votes
1 answer

TFS - running MSBuild integration tests against specific SQL Servers

In our TFS 2013 project we have a set of simple MSBuild based integration tests alongside our unit tests which test stored procedures and other logic which need a database server to be present, for…
Justin
  • 84,773
  • 49
  • 224
  • 367
2
votes
3 answers

(MSTest) Extending ExpectedExceptionBaseAttribute hides test failure explanation

When running this test: [TestMethod] [ExpectedException(typeof(SpecialException))] public void Test1() { throw new NotImplementedException(); } Visual Studio tells me why it fails: Test method [...].Test1 threw …
astef
  • 8,575
  • 4
  • 56
  • 95
2
votes
1 answer

Set-up MSUnit tests using inheritance

I'm trying to set-up a test initialise function that handles some basic database set-up tasks; here's my base class: [ TestClass] public class BaseTest { private SqlConnection sqlConnection; protected SqlTransaction sqlTransaction; …
Paul Michaels
  • 16,185
  • 43
  • 146
  • 269
2
votes
1 answer

C# MSTest Assumptions

Is there a way in MSTest to not run a test when certain assumptions are invalid? Like JUnit's "Assume.*" methods: //Setup Assume.assumeEquals(2, count); //Only run the rest of the test when count==2 I realize that I can easily write my own…
David Tanzer
  • 2,732
  • 18
  • 30
2
votes
1 answer

The agent process was stopped while the test was running. Test execution from TeamCity

When i try to execute build dll's using MSTest/command prompt from teamcity integration all test fails with error. Even it not open browser instance and fails silently using MSTest 10 and MSTest 11(Visual studio 12) Error : "The agent process was…
shiv
  • 497
  • 3
  • 17
2
votes
1 answer

Is it possible to make ReSharper to only run tests with some category in all test projects of my solution?

There is a way but it's bad and I am looking for something cleaner. I can go to menu and select Run All Test in Solution. This brings all tests to the session. But not all our tests are runnable -- there is a set of tests that designed for…
Schultz9999
  • 8,717
  • 8
  • 48
  • 87
2
votes
1 answer

NCrunch Won't Build After Deleting Extra Solution Configurations

We had a solution with several additional solution configurations beyond the typical Debug and Release, and are going back to simply a Debug and Release. A few projects did not have a Debug build, or did not have a Release build. I have: Re-added…
nklhead
  • 336
  • 3
  • 5
2
votes
2 answers

For unit tests written in F# with mstest in vs2012, how do I assert that an exception is raised?

I'm writing unit tests in F# using MSTest, and I'd like to write tests that assert that an exception is raised. The two methods that I can find for doing this are either (1) write the tests in C# or (2) don't use MSTest, or add another test…
daazc
  • 23
  • 2
2
votes
2 answers

Windows Store App Unit Testing a USB device

I'm writing a USB device API for Windows Store Apps that uses Windows.Devices.USB API from Windows 8.1 to connect and communicate with the custom USB device. I'm using the Visual Studio 2013 dev preview IDE. The following function in the library is…