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

change directory of generated unit test files

In visual studio 2008 Professional, when I create a unit test for a method (using the native vs studio framework and wizard), the generated test file stub is saved in the root directory of the test project. When I later move the test file to a…
HugoRune
  • 13,157
  • 7
  • 69
  • 144
2
votes
1 answer

MSTest throws ‘System.TypeInitializationException’ when testing extension methods for a static class in c#

I have a static class called Helpers which contains a good number of simple helper methods including some simple extension methods on ‘string’ and the like: public static string AddSquareBrackets(this string str) { return "[" + str + "]"; } I…
Philip.ie
  • 1,506
  • 1
  • 17
  • 19
2
votes
3 answers

Automating C++ unit test runs for WinRT

Since running Metro apps headlessly is still a gray area: Running a metro app headlessly, I've recently decided to add a native unit test project to my Windows Metro app in hopes that I can find a way to run these unit tests in an automated fashion…
Jeff
  • 623
  • 3
  • 8
  • 22
2
votes
1 answer

Different UnitTest executions in one MSTest settings file

I hope somebody can help me. I have a lot of UnitTest to my C# application in VS2010, and therefore I want to execute them in parallel so I can benefit of my four core machine. This is "easily" done by adding parallelTestCount="0" to the execution…
JerryA
  • 153
  • 1
  • 8
2
votes
1 answer

MSTest fails with error message 'Results file does not exist. Publish failed'

We are using TFS 2010 to build our solutions and run unit tests (MSTest). Everything used to work fine and our builds succeeded when all unit tests passed. However, after updating our test projects to .Net 4, all builds fail with error message…
sorteberg
  • 51
  • 6
1
vote
1 answer

How do I migrate a NUnit configuration file to MSTest?

I would like to migrate all my unit tests from NUnit to MSTest. In the solution I have a NUnit configuration file, which looks like this:
p2u
  • 300
  • 1
  • 9
1
vote
2 answers

Is there a way to disable/ignore a Load Test in Visual Studio 2010 without using Test Lists?

I'm new to load testing in Visual Studio/MSTest, and I created a new Load Test recently to validate some high-traffic scenarios for a WCF service. I want to add this to the tests project for the service, but I don't want the test to be executed…
Caleb Bell
  • 520
  • 6
  • 23
1
vote
0 answers

MS Test Default Test Project

I have a solution that contains several class library projects, and a test project for each class library project. When I right-click a method and select Create Unit Tests, the Create Unit Tests dialog pre-selects a test project I have not worked…
Eric J.
  • 147,927
  • 63
  • 340
  • 553
1
vote
0 answers

DeploymentItem (mdf-File) and Connection String

I'm working with Visual Studio Testing Tools, and I'd like to write some database tests. Therefor I added a Data\Test.mdf file to my solution, and added a DeploymentItemAttribute to my test: [DeploymentItem("\\Data\\Test.mdf")] The test project has…
Matthias Meid
  • 12,455
  • 7
  • 45
  • 79
1
vote
1 answer

What is the impact of ReSharper's "Run tests even if Code Coverage is enabled" for MSTest?

In the options menu of ReSharper, under Tools > Unit Testing > MSTest, you can enable MSTest, and then there is a checkbox "Run tests even if Code Coverage is enabled". Wat is the impact of enabling this option? It was initally off, but as Code…
Peter
  • 13,733
  • 11
  • 75
  • 122
1
vote
1 answer

MsTest with Task.ContinueWith() and Task.Wait()...?

I'm still in .NET 4.0 and I was wondering whether this pattern will hold up well in various kinds of async unit testing situations: /// /// Noaa weather test: should read remote XML. /// [TestMethod] public void…
rasx
  • 5,288
  • 2
  • 45
  • 60
1
vote
2 answers

OpenCover showing 0 lines covered with mstest

'here is output...' Loading C:\TEMP\BankDemo_mstest\Test_BankDemo\bin\Debug\Test_BankDemo.dll... Starting execution... Results Top Level Tests ------- --------------- Error …
sureshp
  • 13
  • 6
1
vote
2 answers

Print MSTest summary after command line exeution

When running a large set of tests using MsTest from the command line, I can see each test executing and its outcome logged in the window like so: Passed Some.NameSpace.Test1 Passed Some.NameSpace.Test2 And so on for thousands of…
Anders Forsgren
  • 10,827
  • 4
  • 40
  • 77
1
vote
1 answer

VSTS RIG Setup configuration - Agent Machine in "Disconnected" Status

Im using VSTS controller agent setup to run a load test of a Web Application. I have 3 machines configured for this RIG setup. My machine (MACHINE 1) is configured as one Controller. Apart from my machine, I have another controller machine (MACHINE…
Udhay
  • 71
  • 4
  • 15
1
vote
1 answer

Moq context.server.transfer

For a unit test I use moq to mock the HttpServerUtilityBase attached to a HttpContextBase. This is so that when the function under test can call context.server (ASP.Net). However, when the tested method does context.server.transfer, when done in the…
Richard Craggs
  • 155
  • 1
  • 2
  • 7
1 2 3
99
100