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
1 answer

MsTest - Speed improvements

So i'm stuck with the ugly sister of NUnit. Anyone know of ways to speed this up? It appears to be keen to rebuild EVERYTHING when I just want to re-run the tests (which is not neccessary as I haven't changed any code). While we're at it does anyone…
Quibblesome
  • 25,225
  • 10
  • 61
  • 100
2
votes
2 answers

Is there a functional difference between Assert.IsNotNull(·) Assert.AreNotEqual(null,·)?

Is there a functional difference between Assert.IsNotNull(·) Assert.AreNotEqual(null,·)? I prefer the first, as it's more readable. A colleague used the second, I wondered if there's also a functional difference. I know comparing objects to null…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
2
votes
3 answers

Specflow and HttpSelfHostServer

I've created a self-hosted implementation of ASP.NET Web API and want this to run in SpecFlow tests. So in my Specs i have a step firing up the selfhostserver as such: var config = new HttpSelfHostConfiguration("http://localhost:9000"); var…
John Korsnes
  • 2,277
  • 2
  • 20
  • 31
2
votes
2 answers

obtain command line arguments in unit test

In a Test project in Visual Studio 2008 (Pro), I created a Test project, and I want to configure the project properties to give a command line argument to the tests. I set the properties, but then realized I have no idea how to actually use the…
Ben Collins
  • 20,538
  • 18
  • 127
  • 187
2
votes
1 answer

Why DataDriven tests no longer run on Jenkins when using MSTest?

I have a suite of Webdriver tests which are written with C# and I am using MSTest as a runner. At this point NUnit is not an option, so I need to figure this out how to make it work with the current configuration. For CI I am using Jenkins ver.…
vali83
  • 157
  • 1
  • 4
  • 13
2
votes
1 answer

MSTest execution stuck when running through command line

I am attempting to run UI tests (using Windows Automation API) on a WPF application, on a CI basis. I have associated my solution with a .testsettings file and linked my test .dll to the build process. All seems to be well. When I queue a new build,…
Tal Bronfer
  • 759
  • 5
  • 18
2
votes
0 answers

is copying MSTest executable and related dlls is the only solution to run ms tests in non visual studio environment?

I need to come of with the approach where: I need to run Visual Studio Unit/Integration tests in environment where visual studio will not be installed. After lots of fiddling around i came up with one approach that is to copy MSTest.exe and related…
Bravo11
  • 898
  • 2
  • 11
  • 24
2
votes
2 answers

In MSTest how to find the total number of tests to run in ClassInitialize or AssemblyInitialize?

Using MStest - I want to find the total number of test methods which are queued for run. How should I capture this value in ClassInitialize() or AssemblyInitialize() method. Only thing I get is TestContext which has no details of total number of…
SarkarG
  • 687
  • 1
  • 8
  • 30
2
votes
2 answers

XmlSerializer behaves differently in MSTest runner and NCrunch

A colleague of mine encountered a situation where the XMLSerializer behaves differently when run via MSTest Runner or via NCrunch. When running test through N-Crunch the output contains xmlns:xsd="http://www.w3.org/2001/XMLSchema"…
tymtam
  • 31,798
  • 8
  • 86
  • 126
2
votes
0 answers

MSTest - concurrent tests or sequential?

Having researched this extensively I'm now confused. Can someone clear up my confusion? I need to be sure that when I run a series of 'unit' tests with MSTest they each start after the previous test has completed. I don't have an issue with thread…
haughtonomous
  • 4,602
  • 11
  • 34
  • 52
2
votes
2 answers

DelegatingHandler setting CurrentPrincipal

I am trying to unit test an implementation of DelegateHandler. My simplified implementation: public class FooHandler : DelegatingHandler { protected override async Task SendAsync( HttpRequestMessage request,…
Vegard Larsen
  • 12,827
  • 14
  • 59
  • 102
2
votes
1 answer

Abort running MSTest unit tests in VisualStudio 2012

How do I stop a running MSTest unit test in VisualStudio 2012? This seems silly, but I can't seem to find a way. I accidentally wrote a unit test that gets stuck at some point and waits forever.
Efrain
  • 3,248
  • 4
  • 34
  • 61
2
votes
1 answer

Why Opencover with MSTest does not execute and says "access is denied"?

I am using open cover with MSTest. I am a new users and trying to get hang of Opencover. I have tried with MSTest and MSTest is working fine with my new project in Vs2010. When I am executing following test using MStest it is working fine: Command…
Pushkaraj
  • 62
  • 8
2
votes
2 answers

How to reach full CodeCoverage? Free Blocks through Exception

I've got a little Problem.(at unittesting) - I unittest a class where methods raises exceptions. The structure is: public bool DoA() { ThrowException(); return true; } public void DoB() { …
basti
  • 41
  • 1
2
votes
2 answers

Experiencing "DEP3000" error when trying to run WinRT unit tests

I am experience this strange error trying to run unit tests for WinRT from Visual Studio 2012. Error: DEP3000: Attempts to stop the application failed. This may cause the deployment to fail. App Packages may only be shutdown as part of a…
Earlz
  • 62,085
  • 98
  • 303
  • 499