mstest

Running Visual Studio 2008 C# (MSTest.exe based) unit tests in Mono

Hello, I'm using VS2008 to develop a project that I'm starting to test under Mono. There are a number of unit tests written using the VS unit test framework, is there a tool that will let me run these in Mono? Thanks, ...

Integrating MSTest with Cruise control for multiple projects

Hi All, I have integrated MSTest with cruise control for single project by following the steps present in the below link.Its working fine http://www.codeproject.com/KB/tips/VSTS2008_Tests_With_CCNET.aspx?display=Print. But if i add multiple projects, the result file is getting over wrtitten by 2nd project result. I am not able to see t...

How can I emulate MbUnit's [MultipleCulture] attribute in MSTest?

MbUnit has a great attribute: MultipleCultureAttribute. I am wondering if there is an easy way to do this in MSTest? So far, the best I can come up with is: Externalizating the actual test code to a private method Saving the current culture Setting the culture and calling the private method (repeated for each culture) And finally, rev...

Running mstest *without* it using a ThreadPool

I'm writing some managed code to wrap a the native calls for IntervalZero's RTX product. RTX basically enables real time coding under Windows by setting up a kernel proxy. What's important here is that RTX generates the proxy when DllMain gets called with DLL_THREAD_ATTACH (and tears it down on DLL_THREAD_DETACH). If that proxy hasn't...

Organization of Unit Tests in Visual Studio

I'm currently creating a paired unit test assembly for every assembly in my project, both are in the same folder. MyProject/MyProject.csproj MyProject.Test/MyProject.Test.csproj Looking at open source projects, I've seen some smaller project put all tests in one assembly, and other split it out like mine. I'm dealing with a large so...

MSTest crash during a build in TFS 2008 SP1

I've never managed to make MsTest works during the build of my solution on TFS. When I look the build log, I see this that TFS want to execute MsTest : "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" /nologo /searchpathroot:"C:\BinaryRoot\TFSBuild" /resultsfileroot:"C:\TestResults\" /testmetadata:"C:\Build\MySoluti...

In migrating from Java to C# what should I know about accessor classes

I am a Java programming now also writing in C#. I have seen Accessor classes generated by the VS test generating software (to give access from Tests to private members or functions). Should I be creating Accessors deliberately and if so why ...

XML data for Unit testing

We are looking to run a large amount of data through some unit tests. We would like to define this in some sort of excel spreadsheet or XML document. Is there away to get the unit testing framework to load this data as input and expectations. I can foresee this having issues with exception catching. Any comments on this are appreciat...

Equivalent of assert.warning in mstest ?

is there a MsTest Equivalent of Assert.Warning in MbUnit ? ...

MSTest doesn't find tests when switching from MbUnit to MSTest

We had a test project that started out as MbUnit v3 / Gallio but decided to go to MSTest. We took out the Gallio/MbUnit tests and added the reference to the MSTest stuff (Microsoft.VisualStudio.QualityTools.UnitTestFramework) and swapped out the C# attributes to use MSTest verbiage ([TestMethod], etc), but when attempting to run tests Vi...

Resharper problem with unit tests

I'm having a little annoying problem with resharper trying to run my unit tests, using mstest. I can select an individual unit test and run/debug it fine but when I select the parent node to run a bunch of tests, the tests don't run; it just displays pending for a few seconds and then the test goes grey. If I set breakpoints in the tests...

MSTest for huge legacy codebase

Hello, we have a huge codebase with about 1000k lines of native/unmanaged legacy c++ - code and we are going to provide the code with unit tests and MSTest would fit perfectly in our current development environment (TFS, VS 2010, ...). I know that MSTest is orginally meant to test managed code but its also possible to write unit tests ...

Are there MSTest collection constraints that are similar to NUnits

I am working on a project utilizing MSTest and I need similar constraints for testing arrays/lists that NUnit provides (http://www.nunit.org/index.php?p=collectionConstraints&r=2.4.8) Is there anything similar built-in or as an add-on to the MSTest framework? ...

Switching from MSTest to another unit test framework in VS 2010

Hi, Visual Studio 2010 offers a lot of comfortable tools for unit testing via its built in test runner. Unfortunately we can't use MSTest for our unmanaged c++ codebase. Is it possible to switch from MSTest to e.g. Google.Test and have it integrated with the built in Visual Studio test runner? Thanks in advance! ...

Is summary necessary in unit test method

Since the naming of a unit test method makes its purpose more meaningful, is it necessary to add a summary to a unit test method? Example: /// <summary> /// Check the FormatException should be thrown when a give country data line contains a invalid number. /// </summary> [TestMethod] public void FormatException_Should_Thrown_When_Parse...

app.config for unit test assembly: how to make the appsettings 'file' attribute work?

I need to read a setting from the appsettings section (defined in app.config) in a unit test. We're using mstest in this project. Say this is the app.config: <configuration> <appSettings> <add key="MyAppSetting" value="MyAppSettingValue"/> </appSettings> </configuration> Here's the corresponding test, which passes in this setup:...

Global test initialize method for MSTest

Quick question, how do I create a method that is run only once before all tests in the solution are run. ...

What is the MSTest Attribute for including a test resource?

I want to have a test resource that is available during my test and I know there is an attribute that deploys the item. What is the attribute? ...

Assembly context being changed in MStest- Possible to avoid?

I am trying to use MSTest on our code base. Now I am running into different problems during this. We implicitly use _getDefaultName from Microsoft.Practices.EnterpriseLibrary.Data and it gets the default connection string in the current Assembly's App.config. Since this test project would be a new assembly/project it is not able to fin...

How to deploy directories to test output folders in Visual Studio 2008 Team System?

When open my LocalTestRun.testrunconfig file Deployment section I can choose which files are deployed to the Test output folders, but I need that a specific file to be deployed in a given subfolder. How to do that? ...