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

Can NUnit and Visual Studio 2008 integrated testing be used side by side?

I am interested in improving my testing methodologies but am not sure if I prefer NUnit or VS 2008 test. I also have a book that uses NUnit in it's examples. Do the two frameworks coexist well with each other?
Eric
  • 21
  • 1
2
votes
1 answer

Is there a way to use both a .testsettings and .runsettings file in Visual Studio 2013?

I have an existing .testsettings file that is being used by Visual Studio for running tests. We are starting to use the built-in code coverage tools with Visual Studio 2013 Ultimate. Custom rules can be stored in a .runsettings file, and the project…
Codeman
  • 12,157
  • 10
  • 53
  • 91
2
votes
1 answer

Is there an attribute to set test timeout for all tests in TestClass at once?

I have mstest TestClass that contains 35 tests now and that might grow. Methods tested are often recursive (so there might be bug causing infinite loop), so I want to set timeout for those tests. Is there a way (ideally an attribute) to set same…
Rasto
  • 17,204
  • 47
  • 154
  • 245
2
votes
1 answer

Run same MSTest tests with different parameters

Although my current context is SharePoint related this question applies to testing in general where I would like to run the same set of tests but with different parameters. I have existing tests that test my Sharepoint code (that use the SharePoint…
2
votes
1 answer

Testing a PCL with F# FAKE

I have a solution with a PCL class library project and a test project testing the library (MSTest). The PCL uses Microsoft.Net.Http and Microsoft.Bcl.Compression to do some gzip downloading. Both the PCL and the test project reference both…
Igor Kulman
  • 16,211
  • 10
  • 57
  • 118
2
votes
1 answer

Integration testing private classes and methods

For unit testing you shouldn't test private methods, yes, but for integration tests (using a unit testing framework like MSTest or NUnit) I would very much like to run the internal API calls against a test url, to make sure the current code works…
Aquinas
  • 188
  • 2
  • 16
2
votes
2 answers

Future considerations for NUnit and NAnt

During .NET v1 days, I have tried without much success to convince colleagues to develop test-driven and automated-build work habits using the additional tools of NUnit and NAnt. When .NET Framework 2.0 and Visual Studio 2005 Team Suite came into…
icelava
  • 9,787
  • 7
  • 52
  • 74
2
votes
1 answer

mstest error - qtagent32.exe has stopped working

I builded a simple test dll (net 3.5, Debug, x86) using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestProject1 { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { …
user3096771
  • 51
  • 1
  • 4
2
votes
1 answer

Why an unhandled exception on a unittest does not make it fail using MSTest?

today we realized that some tests where throwing exceptions but all the tests where 'pass'. In fact the exception text was shown in green. Does this make sense? Is there a way to make the tests fail if an exception is unhandled (I know that most of…
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
2
votes
1 answer

How to use CollectionAssert (and Linq?) to find all the values for one property, are the same?

this is an extension to a previous question I asked, today .... which highlighted the use of CollectionAssert to help test collections (which I never knew). I have an ICollection foos; This has a property called Status, which .. to keep things…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
2
votes
4 answers

Debug.Assert interferes with MSTests, how do I work around it?

So I have a method i'm unit testing via MSTests to ensure it throws an exception properly on bad data coming in. However that method has Debug.Assert so it's caught while debugging if it happens during an actual test where I'm in debug mode trying…
Maslow
  • 18,464
  • 20
  • 106
  • 193
2
votes
2 answers

MSTest with Moq - DAL setup

I'm new to Moq, and just started on a project that's already in development. I'm responsible for setting up unit testing. There's a custom class for the DatabaseFactory that uses EnterpriseLibrary and looks like this: public Database…
2
votes
1 answer

Team City MSTest runner exits with not zero code - Symantec

I am trying to set up Team City CI on Server 2012R2 The MSTest build runner step fails to run. NunitLauncher.exe fails on server 2012[R2], even from command prompt NunitLauncher.exe runs fine on Server 2012. This works fine at home on the following…
2
votes
1 answer

Setup and cleanup scripts with .runsettings?

We have a testing environment using Visual Studio 2013 and MSTest where we need to run a setup script (.cmd-file) before starting certain test runs. Currently we are using .testsettings files for this purpose, which works great. However a problem…
DeCaf
  • 6,026
  • 1
  • 29
  • 51
2
votes
1 answer

cannot load web.config in mstest

I need read connection string from web.config which in asp.net mvc project, but all i get are null. how can i obtain connection string in mstest, do i need additional configuration in some where?
user261488
  • 21
  • 2