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

VS2010 Debugger Breaking on Handled Exception

I have MS Test unit tests that ensure that an Exception is thrown when the method under test is given bad arguments. I'm using the pattern: My actual; bool threw = false; try { actual = target.DoSomething(aBadParameter); } catch { threw =…
Eric J.
  • 147,927
  • 63
  • 340
  • 553
1
vote
0 answers

Unit Test Mutually Authenticated ASP.Net Webservice

I intended to test an ASP.Net webservice under IIS using the test facilities offered by Visual Studio. I have jumped many hurdles to get to the point where, had the requirements just called for server authentication, everything would have been fine.…
Paul Coombes
  • 145
  • 1
  • 10
1
vote
1 answer

How to execute multiple tests in one method?

I'm new to the Visual Studio Unit Testing Framework. I've dabbled a little in XUnit, though (DUnit to be specific). I don't know why the following tests are failing. Based on my C# code (exhibit A), I would think my tests (exhibit B) would pass with…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
1
vote
1 answer

Catching Errors from MSTest running inside MSBuild

I'm calling MSTest like this:
VK Macwana
  • 21
  • 3
1
vote
1 answer

Running mstest.exe with a web test that calls another web test

I have a web test, let's call it WebTestParent that calls another web test, WebTestChild. There is no problem when I run it from the IDE, but when I try running it from the command line using mstest, like this: C:\MySolution> mstest.exe…
Paul
  • 1,224
  • 2
  • 14
  • 31
1
vote
0 answers

MSTest, Targeting multiple Framework version

We use TFS (2010) for Continuous Integration. Solution Contains .NET 4 ,and Silverlight 4 projects. Everything was working fine, until one day MSTest.exe stopped running UnitTest dlls, with this message : A test run can only be targeted to single…
HevaR SHIN
  • 11
  • 2
1
vote
3 answers

Generate assert statements on all public properties of an object

In my current project we want to test our mapping from sql to datamodels through a set of integration tests. For this we need to basically assert all public properties on an object. Is there a way to automatically generate assert statements for all…
Boris Callens
  • 90,659
  • 85
  • 207
  • 305
1
vote
1 answer

VS 2010 log4net MSTest MSUnit not logging to console(but logs to file fine)

This ends up boiling down to the simple question of why does Console.WriteLine("asdfasdf") not get output to the output window in Visual Studio 2010??? as mine is not being output there when running tests. I have a log configuration file that when I…
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
1
vote
1 answer

MSTest code coverage file is too big, How to selectively generate code coverage

I have an MSTest code coverage setup in my visual studio project. However, when the code coverage runs, it generates a coverage file (data. coverage) that is too big. The reason being it scans for all the dlls, third party libraries. My project has…
Sriwantha Attanayake
  • 7,694
  • 5
  • 42
  • 44
1
vote
1 answer

Visual Studio 2010 Code Coverage on Partial Classes

I am using Visual Stdio 2010 and its testing and code coverage features, and I have a bunch of generated code that I don't want to be included in code coverage results. These are generated as partial classes. I've read in a few places (example:…
Scott Isaacs
  • 1,168
  • 7
  • 16
1
vote
2 answers

Unit Testing using VS2010

I am unit testing a method say ABC() like myclass target = new myclass(); target.ABC(); This ABC() method in turn calls another method XYZ() from a different class like anotherclass.XYZ() and this XYZ() method's input parameter depends on values…
Rahul
  • 76,197
  • 13
  • 71
  • 125
1
vote
1 answer

Upload Image to Cloud UnitTest

I am trying to upload an image to a cloud and i want to be able to test this, here is what i have tried already, I dont really understand fully what im doing, so if somebody could tell me what to do, I would appreciate it. I have included the main…
user1081326
  • 415
  • 5
  • 10
  • 19
1
vote
1 answer

Looking to refactor Appsettings and HttpContext for unit test and moq

I have looked at a lot of examples, but in this case I wish to get a fresh set of eyes on refactoring this method below so that I can unit test it. I'm using mstest with moq and I know that the appsettings is a problem, along with the HttpContext…
Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
1
vote
2 answers

How can a webtest be made to accept file downloads?

I'm using Visual Studio Team Foundation Server 2008 Team Suite to create a webtest for a site. On some pages the response is a file download (usually a PDF), and I just need to test that the response comes back with the right status code and…
tspauld
  • 3,512
  • 2
  • 25
  • 22
1
vote
1 answer

MS Unit tests fails run half of the time

I got this odd behaviour I launch tests from MS Test List Editor. And first time I launch I always get this error currently Error 11/15/2011 4:28:32 PM Failed to queue test run 'USER@MACHINE 2011-11-15 15:28:29': Unable to start program…
Valentin Kuzub
  • 11,703
  • 7
  • 56
  • 93
1 2 3
99
100