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
0 answers

In MSTest tests in VS2010, is there a way to see the standard output in the output window while debugging them?

Sometimes when I'm writing unit tests, I want to debug the test and see the standard output (console output?) as I'm stepping through the code. In my case, my ORM is generating sql queries and showing them in stdout and I'd like to know what its…
Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90
2
votes
1 answer

Cancel tests (with warning) from

My project has some unit tests. They all depend on some external service, over which I have no control. This service is frequently down (recall Twitter circa 2008). Currently, if the service is down, then the tests fail, and the continuous…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
2
votes
2 answers

MSTest: A sensible way to deploy items from a common directory?

I have lost a few hairs when trying to deal with DeploymentItem recently. We have a few common directories for native dll's, and many tests depends on these. For C++ projects, we use propertypages, where these paths are defined. These can even be…
Oyvind
  • 568
  • 2
  • 6
  • 22
2
votes
3 answers

How to force fail a test in C# with MSTest

I am trying to port some of my WebDriver tests from JAVA to C#. What I'm stuck on is the situation when the driver cannot find some element on the page, in JAVA I do : if (second >= 10) fail("timeout - " + list); so if something takes more than 10…
tom
  • 1,223
  • 6
  • 16
  • 26
2
votes
4 answers

How to assert if any string in a list of strings is contained in the Actual string

I have the following strings: Actual | Expected "The Actual String" | "The" | "Actual" | "String" | "Other string" | ... I need to create a method…
chaliasos
  • 9,659
  • 7
  • 50
  • 87
2
votes
3 answers

Unit Testing Adding to Zip / Extracting from Zip

I have the following code for adding to/extracting from Zip. I'm trying to refactor this to make it test-ready. Can someone provide pointers on how I can accomplish this? Aside: I'm using Moq as my mock framework and MSTest as my Unit Testing…
Vyas Bharghava
  • 6,372
  • 9
  • 39
  • 59
2
votes
2 answers

Visual Studio Cannot Scan/Find MSTest Methods

I converted a project with nunit tests, so that it had mstests instead. It compiles, and when I right click on the project, I can select "run unit tests." It works, and the tests execute successfully. However, I cannot see my tests in either the…
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
2
votes
2 answers

Inject custom data in mstest trx output file

In our Cruise Control build, we run a suite of Selenium tests for 3 browsers. To do that, we run the same suite of tests through MSTest but we change the app.config file between each run to setup the browser to be used. The problem is that in the…
Merwan
  • 453
  • 1
  • 5
  • 16
2
votes
1 answer

MsTest in TeamCity: tests found for one build configuration but not another

I have a TeamCity project set up with two build configurations. One runs every three minutes, in a continuous manner. The other runs every hour, on the hour. These used to be one configuration, until I split out the continuous build. Both…
cbohling61
  • 23
  • 5
2
votes
1 answer

Loading localized resx files during TFS test runs

We are using .resx files for internationalizing our app. Our solution and tests (mstest) works perfectly localy, and when deployed, however when we try to run the tests from Team Foundation Server (TFS) it seems the resource files are not found…
user1422518
  • 63
  • 1
  • 4
2
votes
1 answer

junit test results in tfs

How to make TFS 2010 show junit test results, that were generated by third-party tool? If it can't, probably, there is a way to convert junit report to xunit/nunit/mstest report. It would be also great! Thanks.
Max Tkachenko
  • 504
  • 1
  • 6
  • 17
2
votes
1 answer

MSTest: Ignore Intergration tests that rely on network when network is unavailable

Does anyone know away of ignoring selected tests when the network is unavailable. Something like a conditional Ignore attribute?
jflood.net
  • 2,446
  • 2
  • 21
  • 19
2
votes
0 answers

Unit Test Explorer in Visual Studio 11 fails with reference to the Microsoft Smooth Streaming Client SDK Beta 1 assembly

Having a reference to the Microsoft.Media.SmoothStreaming.dll in a Metro Style App project, then attempting to run tests from a separate Unit Test project that references the Metro Style App assembly does not work in Visual Studio 11 (Ultimate Beta…
2
votes
1 answer

Object Disposed Exception when using .Net Trace Source within VS UNit Tests

I'm getting an Object Disposed Exception when I try to call TraceSource.TraceData with my VS2008 unit test project. I have included a very small code sample below which consistently repros the issue. I'm only seeing this after I run my first unit…
will
  • 3,975
  • 6
  • 33
  • 48
2
votes
1 answer

VS2010 Code Coverage Not Accurate

I'm using Visual Studio 2010 Ultimate SP1. I have around 225 unit tests in my project, and they are all passing. One of those tests, however, reports 0% code coverage for the method it hits. When debugging, I can step through and see that it hits…
jvaran
  • 55
  • 6