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
24
votes
8 answers

Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=11.0.0.0'

I am using MSTest.TestAdapter and MSTest.TestFramework both version 1.2.0 for my MS tests unit tests. On my local machine (Visual Studio 2017) the tests run perfectly, but on our build server we get this message: Could not load file or assembly …
Ben Croughs
  • 2,566
  • 1
  • 20
  • 30
24
votes
5 answers

How do I write context/specification style unit tests with an MSTest/xUnit framework?

I have been using MSpec to write my unit tests and really prefer the BDD style, I think it's a lot more readable. I'm now using Silverlight which MSpec doesn't support so I'm having to use MSTest but would still like to maintain a BDD style so am…
Charlie
  • 10,227
  • 10
  • 51
  • 92
24
votes
6 answers

Writing Unit Tests: How to get folder with testfiles programmatically

I am writing unit tests in visual studio 2010. For test some functionality, I have added a folder with testfiles. I need to get this folder programmatically without a hard path in a string. The folder contains in /TestFiles I have…
hwcverwe
  • 5,287
  • 7
  • 35
  • 63
24
votes
5 answers

How to parallelize a Data-Driven unit test in Visual Studio 2010?

I know regular MS-Test unit tests can be parallelized on a multi-core machine (with caveats of course) by specifying parallelTestCount attribute in the .testresults file in the test solution. Like this,
Vin
  • 6,115
  • 4
  • 41
  • 55
24
votes
3 answers

Running unit tests on Team Foundation Server (TFS) builds

What are the steps to get Team Foundation Server running unit tests when a given build runs? What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time? What are…
Dan Esparza
  • 28,047
  • 29
  • 99
  • 127
24
votes
4 answers

how does MSTest determine the order in which to run test methods?

edit: note, question 288805 is similar, however, I specifically am asking how does MSTest choose the default test order. Please see the rest of this question. Thank you Eilon for the link. I was looking at a legacy MSTest project. The tests were…
gerryLowry
  • 2,626
  • 5
  • 35
  • 44
23
votes
6 answers

Assert.Inconclusive and IgnoreAttribute

What is the right way to use Assert.Inconclusive and IgnoreAttribute in MS Unit test framework? We are using Assert.Inconclusive mainly for tests which are: Not implemented yet Somehow broken or incomplete = requires futher attention When test body…
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
23
votes
7 answers

No tests to execute msTest

I'm trying to run .NET unit tests on the command line using MSTest My command is "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:"full path of dll" /resultsfile:TestResults.trx When run it…
mogoli
  • 2,153
  • 6
  • 26
  • 41
23
votes
5 answers

Getting PartCover to work

I want to try PartCover for code coverage. I'm running Visual Studio 2008 Professional with MSTest. The Professional Edition does not include the Team Testing tools, like Code Coverage. So, I'm trying PartCover, but I can't get it to work. In the…
sgwill
  • 9,814
  • 8
  • 35
  • 40
23
votes
9 answers

Does VS2010 Code Coverage support nUnit?

According to this schema VS2010 Premium and Ultimate has a tool for checking Code Coverage - together with a few other testing tools. Does this support nUnit too, or just MS test?
stiank81
  • 25,418
  • 43
  • 131
  • 202
23
votes
5 answers

How to run ClassCleanup (MSTest) after each class with test?

I have several classes with tests suites. Each test class starts from ClassInitialize and finishes by ClassCleanup. My problem is that ClassCleanup isn't called at the end of each class, it's called only after all tests in three classes. Can I fix…
Ellina
  • 273
  • 1
  • 3
  • 7
22
votes
3 answers

Switching Between Using NUnit and MSTest for Unit Testing

How can I configure a .NET solution (C#, .NET 2.0) to to allow other developers to make use of the same unit tests for the solution using either NUnit or MSTest? Background: In this project, some developers use VS2005 Team Edition, and others make…
Tangiest
  • 43,737
  • 24
  • 82
  • 113
22
votes
9 answers

MSTest.exe not finding app.config

I'm currently trying to run MSTest.exe from NCover, but I believe the question could apply generally to running MSTest.exe from the command line. If I have the "/noisolation" argument, then MSTest.exe appears to find and use the app.config as…
Larsenal
  • 49,878
  • 43
  • 152
  • 220
22
votes
3 answers

How to integrate NUnit tests into a TFS 2010 build

What is the best way to integrate nunit tests into TFS 2010? Is it via generic tests or is there a better approach to running them? Ideally I'd like to have the granularity of one generic test per test assembly and have a way to surface the results…
Kevin McMahon
  • 2,643
  • 25
  • 31
22
votes
4 answers

Error trying to run mstest on jenkins

I´m trying to configure MSTest build plugin on jenkins, but I´m getting the following error: Path To MSTest.exe: mstest.exe Result file was not found so no action has been taken.…