mstest

Build fails because mstest keeps unittest dlls open

Hello all, I have a build running through TFS. The build process was 'customised' by overloading the 'BeforeDropBuild' target, where create an installer, remvoe all original build output and leave only our installers there. We also run some unit tests through the build. The problem is that during 'BeforeDropBuild' target, the deletion ...

how does MSTest determine the order in which to run test methods?

edit: note, question 288805 is similar, however, I specifically am asking how does MSTest choose the default test order. please see the rest of this question. Thank you Eilon for the link to http://stackoverflow.com/questions/288805/. I was looking at a legacy MSTest project. The tests were always running in the same order. The order...

Is there a more robust way to integration test my persistance layer app.config?

I have my application broken into the following projects/assemblies Approot/UI AppDomain/business logic/layer Domain.Tests Persistance/db layer Persistance.Tests I'm integration testing the connection string stored in the Persistance assembly using MSTest. currently I am using LocalTestRun.config for the solution to tell it to in...

Can you Profile Ms test integration tests?

I have never done any profiling, and have come across the first place that I really want to do it. Is it possible to profile my MS integration tests? What tools do I need? is there something built-in to VS 2008 professional? ...

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? ...

check output in MSTest unit test

I want to capture output sent to standard out and standard error within an MSTest unit test so that I can verify it. I've captured output before when explicitly running a Process, but is there a way to do with [I guess] the MSTest process itself? For example: [TestMethod] public void OutputTest() { MySnazzyMethod("input", 1, 'c');...

How to create Startup and Cleanup script for Visual Studio Test Project?

I'm using a Visual Studio Test project, am modifying the test config with deployment files, etc. (through the VS GUI) and now I need to write a Startup script for the test run. I have no clue what language or file type or mechanism is used for these scripts. Need a tip. ...

MSTest?: No tests are run because no tests are loaded or the selected tests are disabled ??

I searched SO with no tests are run MSTest but could not find relevant answer. Scenario: I have a c# solution with the following structure: mySolution myProject myProject.MSTests References Microsoft.VisualStudio.QualityTools.UnitTestFramework sutMSTests.cs sutMSTests.cs: using sut; // the System Under...

Getting automated code coverage to work in MSBUILD

I've got a build agent running builds for TFS and I want to enable code coverage. My build file looks like this <PropertyGroup> <RunTest>true</RunTest> <RunConfigFile>$(SolutionRoot)\CITestRun.testrunconfig</RunConfigFile> <RunCodeAnalysis>Default</RunCodeAnalysis> <TreatTestFailureAsBuildFailure>true</TreatTestFailure...

Excel Process Hangs when Run by MSTest from CruiseControl.NET

I'm using CruiseControl.NET with MSTest to build my Excel add-in. Some of my tests involve opening Excel, performing some operations and checking the results. This is all achieved through COM. If I run the tests from with Visual Studio 2008, they work perfectly. However, when the tests are started by CruiseControl, the Excel process ...

MSTest Equivalent for NUnit's Parameterized Tests?

NUnit supports a feature where you can specify a set of data inputs for a unit test to be run multiple times. [RowTest] [Row(1001,1,2,3)] [Row(1,1001,2,3)] [Row(1,2,1001,3)] public void SumTests(int x, int y, int z, int expected) { ... } What's the best way to accomplish this same type of thing using MSTest? I can't find a similar...

NUnit vs Visual Studio 2010's MSTest?

I realise that there are many older questions addressing the general question of NUnit v MSTest for versions of Visual Studio up to 2008 (such as this one). Microsoft have a history of getting things right in their 3rd version. For MSTest, that is VS2010. Have they done so with MSTest? Would you use it in a new project in preference to...

Running unit tests under Chess

When trying to run my unit test under Chess, it get the following error: Hosting rules specify that the test type 'Unit Test' cannot run in the host adapter 'Chess'. To run this test in 'Chess', change the hosting rules. To use the default test host for tests that cannot be run in the specified host adapter, change the te...

NUnit vs MSTest - a fickle TDD novice's experiences with both of them

There are a ton of questions here on SO regarding NUnit vs. MSTest, and I have read quite a few of them. I think my question here is slightly different enough to post separately. When I started to use C#, I never even considered looking at MSTest because I was so used to not having it available when I was using C++ previously. I basic...

Where is mstest.exe located?

I need to run mstest from the command line - where in the world is this exe located? Can anyone give me a clue? Edit: I only have Visual Studio 2010 installed ...

MSTest - Is it possible to execute code once before all tests run?

Basically I would like to tell MSTest to execute a bit of code before launching into a series of test runs, essentially what I would like to do is the same thing as sticking some code in Main(). The reason I would like to do this is that I would like to do some logging with log4net during my integration test runs. I cannot just use the...

Unable to use a constant as connection string in DataSourceAttribute

I don't understand this behavior. This works: <TestMethod()> _ <DataSource("System.Data.SqlClient", _ "Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=True", _ "MyTable", DataAccessMethod.Sequential)> _ Public Sub TestWithoutConstant() Assert.IsNotNull(TestContext.DataRow) End Sub But ...

Unit Testing Error - "Unable to get type" "Error: Could not load type" "from assembly"

I am getting this error with my new unit test: Unable to get type MyTestProject.MyTestClass, MyTestProject. Error: Could not load type 'MyTestProject.MyTestClass' from assembly 'MyTestProject'.. I have other tests in the project that were working just fine and now they are all showing a similar error message. If I run the test in Resh...

How do I get Visual Studio to place the unit tests where I want them?

In both VSTS 2008 and VS 2010 RC1 when I create a Unit Test (mstest), I am not asked where I would like the project to be placed. It will always turn up at the Solution level. I would like to place the test project inside the folder of the class(es) that are being tested. I have tried unloading the unit test project and adding it to t...

How do I get stdout into mstest output when running in new app domain?

I have been working on test framework, which creates a new app domain to run the tests in. The primary reason being the dll's that we are testing has some horrible code that relies on the dll being located in the app domain path. (No I can't change this code.) The problem that I am having is that my test team is writing a bunch of funct...