mstest

Standard Output from MSTest, NUnit, MbUnit, xUnit.NET test runners

How do you in any of the common .NET testing frameworks MSTest, NUnit, MbUnit, or xUnit.NET get the command line test runner to output a simple yes/no or true/false or 1/0 on whether all the tests passed or failed? I'm open to workarounds like: 1) no output if all the tests passed, output if anything fails. 2) count of tests that fail...

MSTest copy file to test run folder

I've got a test which requires an XML file to be read in and then parsed. How can I have this file copied into the test run folder each time? The XML file is set to "Copy if newer" and a compile mode of "none" (since it's not really a compile-able thing) ...

Does AssemblyCleanup have a time limit

Do methods marked with the AssemblyCleanup attribute have a maximum time limit? We have a method that does a bunch of database deletes for the test data that has been added during the test run, and we don't see that this method is given time to complete fully. (We are using Visual Studio 2008 Team System.) ...

MSTEST Excel 2007 Datasource - Any way to use formulas as cell values?

So I was hoping to do a little boundary testing in an excel-based MSTEST unit test involving dates. The values are actually in decimal format "yymmdd" since the back-end system is an iSeries. Being "clever", I put a formula in a few of the cells to generate a value for TODAY() so I could test that particular scenario. Yesterday, the tes...

Why does Assert.IsInstanceOfType(0.GetType(), typeof(int)) fail?

I'm kind of new to unit testing, using Microsoft.VisualStudio.TestTools.UnitTesting; The 0.GetType() is actually System.RuntimeType, so what kind of test do I need to write to pass Assert.IsInstanceOfType(0.GetType(), typeof(int))? --- following up, this is my own user error... Assert.IsInstanceOfType(0, typeof(int)) ...

Running MStest in cruise control .net build server

I'm trying to setup cruisecontrol.net to work with our existing projects. The projects use the visual studio 2008 testing tools (running as .net 2.0). During the actual build process I get several error messages, most or which are: Type 'TestClass' is not defined. I'm assuming that this is because I don't have the testing framework i...

MSTest executing all my tests simultaneously breaks tests - what to do

Ok, this is annoying. MSTest executes all of my tests simultaneously which causes some of them to fail. No this is not because my tests are fragile and susceptible to build order rather it is because this is a demo project in which I use a Db4o object database running from a file. So I have a couple of DataAccess tests checking that m...

PartCover console produces empty output xml

I'm using partcover to produce codecoverage for a bunch of mstest powered unit tests. I use the command line: PartCover.exe --target "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" --target-args "/testcontainer:c:\CrusieControlProjects\AcademyPro\AcademyTests\bin\Release\AcademyTests.dll" --include [AcademyPro*]* ...

Switching Between Using NUnit and MSTest for Unit Testing

How can I configure a .NET solution (C#, .NET 2.0) to to allow other developers to make use of the same unit tests for the solution using either NUnit or MSTest? Background: In this project, some developers use VS2005 Team Edition, and others make use of VS2005 Pro, so not all of the developers are able to run MSTest. Given that this...

How to run MSUnit tests with MSBuild

I have a MSBuild script which looks similar to: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; <Target Name="Build"> <MSBuild Projects="MyProject.UnitTest.sln" Targets="Build" /> </Target> </Project> How do I run the MSTest unit tests which are within the solution? I am looking for somethin...

MSTest and custom messages

Hello guys, great site. Recently I started using mstest for testing. Is there any way to write messages to test window if test successed? I don't see the way, messages are alowed only if test fails. What if I want to let say, print little description of a test, so I can see what test means without having to open the test. Or, as now is...

run tests in mstest without compiling/building

is there a way? do I have to wait for building every time I start the test? I want to build from visual studio not from test thanks ...

Debugging assembly load issue

Hi, I have a very wierd problem happening to me during unit testing (MSTest in Visual Studio - .NET 3.5 SP1): I click "Run All Tests in solution" All tests passes, except for one particular class, where every tests throws the following exception: "System.IO.FileLoadException: Loading this assembly would produce a different grant set fr...

Unit testing a LINQ2SQL repository

Dear gurus, I am taking my first steps with MsTest and Moq and would like to unit test a Linq2SQL repository class. The problem is that I do not want the unit tests to permantly modify my development database. Which would be the best approach for this scenario? Let each test operate on my real development database, but make sure eac...

Visual Studio Test Project - Does not copy folder on deployment

Here is the problem: 1. Create a TestProject in your Visual Studio solution. 2. Open the .testrunconfig file and under the 'deployment' menu item, select the 'Enable Deployment' checkbox. 3. Now click on 'Add Directory...' button and add a folder which has some files in it. 4. Run the test project (use a dummy test). Ok, now go check th...

After implementing fmod Visual C++ test strange behavior - All tests fail - Unable to get type.... Error: System.IO.FileNotFoundException - if certain line of code in one test

Ok, I've figured out what caused the problem but I still don't know why - it happened when I started using fmod, and it must have something to do with how the linker decides to bring in and execute static libraries and dll's. My code under test is a static lib; it refers to fmodex_vc, another static lib, which at some point (though I k...

Resharper Unit Test Runner: MSTest Deployment Items Issue

http://stackoverflow.com/questions/747263/resharper-unit-test-runner-support-for-deployment-items I have a follow up question for the question above. I'm using resharper version 4.5 with native mstest support to run mstest unit tests. When I configure resharper's unit test options to use my testrunconfig (in order to utilize my set of...

Is it possible to have multiple 'TestClass'es in MSTest?

I'm trying to write unit tests in MSTest and I've created two TestClasses. When I look at the Test List Editor, the only tests that are shown are the ones that appear in one of the classes. I can't figure out how to get tests from both of these classes to run. Any ideas? ...

Using MSTest with MFC

Is there anybody using MSTest to test MFC code? I created a managed C++ Test project and and can write unit tests within it but once I #include <afxwin.h> then I have problems. The code will compile and when it gets to running the tests, the UI hangs and none of the symbols will load. You cannot debug the tests either. If I remove the ...

is there a way to use mstest in my application

is there a way to run mstests inside my application ? these how it should work i should put the project in a folder point my appliaton to it and run the tests thx for your time ...