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 Unit Test - handling exceptions

I have a C# unit test using Selenium WebDriver to test to see if a link exists. Here's the code: [TestMethod()] public void RegisterLinkExistTest() { IWebElement registerLink = genericBrowserDriver.FindElement(By.PartialLinkText…
user1739627
  • 49
  • 1
  • 8
2
votes
0 answers

NCover (v3.4.18.6937) does not collect any coverage information when testing with Moles (v0.94) and MSTest (v10.0)

currently I am trying to get a code coverage with NCover for a MSTest assembly which uses Moles as Isolation framework. After hours of testing NCover does not gather any coverage information. I researched various stackoverflow posts regarding ncover…
2
votes
1 answer

for what layer need to write unit test?

I am new to unit testing / TDD. We are developing a web application with the following architecture: MVC WCF service layer Business Logic Layer DAL with EF I have not done unit testing before but saw it in some projects so I have not a clear…
user576510
  • 5,777
  • 20
  • 81
  • 144
2
votes
1 answer

Custom Data Driven MSTest

I have XML spreadsheet files created from Excel that I need to use as the input for my data driven test. I can't use the DataSource attribute on my test method because of inconsistencies parsing the files with an Oledb provider. I was wondering if…
ryan
  • 6,541
  • 5
  • 43
  • 68
2
votes
1 answer

Iteration Results in trx output

I have been running tests as part of a build for quite some time now (TFS, VS2010, MTM, Lab Management) and have always received the Iteration Data results in MTM (opened in VS2010) via .trx files. After applying some updates to the VMs I to deploy…
Nashibukasan
  • 2,028
  • 23
  • 37
2
votes
0 answers

Parallel.ForEach causing test to timeout

I am working with visual studio test tools and Rhino mocks. I am currently writing a unit test on a method that uses Parallel.ForEach to process data. This is the method I want to test: var exceptions = new…
amateur
  • 43,371
  • 65
  • 192
  • 320
2
votes
0 answers

local.testsettings file that is sensitive to configuration

I am building a library that is built in an x86 and x64 configuration. In unit testing I have to have two files that I select manually one has deployment items from the x64 direcotry and the other has deployment items from the x86 directory. I also…
user1604593
  • 41
  • 1
  • 3
2
votes
2 answers

Multiple unit test run analysis tool

Is there any tool that analyzes test reports of particular unit test runs and shows differences between them? Basically, I'm interested in a "graph of progress": 12 Aug 2012 10:00: 48/50 tests passed. Failed tests: "MyTest13", "MyTest43". 12 Aug…
Skiminok
  • 2,801
  • 1
  • 24
  • 29
2
votes
1 answer

Running unit tests from within VS2008 vs using mstest on the command line

I have recently encountered some inconsistencies in running unit tests inside VS2008 vs running the same unit tests with mstest on the command line. My scenario is a bit advanced, so I have probably hit some corners. I have many data driven unit…
mark
  • 59,016
  • 79
  • 296
  • 580
2
votes
1 answer

MS Test unit testing raised event contents

I'm using Microsoft's Visual Studio Test Tools and Moq for unit testing. I have a method that raises an event and I need to verify that the event's message is correct. For example, the method calls this line of…
Robert Corvus
  • 2,054
  • 23
  • 30
2
votes
1 answer

Is it possible to have factory tests in mstest, like in MbUnit?

We are using mstest for unit tests at our company. The main reason is that there is no free Visual Studio integration for MbUnit (TestDriven.NET is not free for companies). Recently, I have stumbled upon a need to run the same unit tests on two…
mark
  • 59,016
  • 79
  • 296
  • 580
2
votes
1 answer

How to unit test Create POST?

How do I unit test that the journal entry was created correctly (added to the db with the correct values)? [HttpPost] public ActionResult Create( int journalId, string text) { JournalEntry journalentry = new…
O.O
  • 11,077
  • 18
  • 94
  • 182
2
votes
1 answer

Coded UI test and Load test

I have been searching the internet but have not been able to find any real information on, is it possible to have coded UI test recorded in VS that can run with a load test in VS? If it is could some point out the steps on how to connect the coded…
user101010101
  • 1,609
  • 6
  • 31
  • 52
2
votes
1 answer

Cannot cast List`1[MyClass]' to type List`1[MyClass_Accessor]'?

I got the following error when running the test code. How to workaround the issue? I'm using Visual studio 2010 Premium's built-in MStest. Test method TestProgram.myProgramTest.GetTypeListTest threw exception: System.InvalidCastException: Unable…
ca9163d9
  • 27,283
  • 64
  • 210
  • 413
2
votes
0 answers

Unit Test/Code Coverage Warning & Error VS2010

I have a sample test project given to developers on my project team to learn how to use automated tests. When I run the set of unit tests that I have, they all pass but I receive the following Warning and Error: Warning: conflict during test run…
tbmills1
  • 23
  • 6