mstest

How to drill down in the data driven unit tests results on hudson with mstest.

Dear sirs. Our CI server is powered by hudson with mstest. We use the hudson mstest plugin. Everything works fine, except there is a problem when a data driven unit test fails. The mstest plugin does not know to drill further down the data rows, like the Visual Studio does when one clicks on a failed data driven unit test. So, when a d...

Why PartCover report shows 0% when mstest runs successfully and all tests pass

Hello, I'm trying to get code coverage with mstest tests. I'm using PartCover 2.2.0.36424. The problem is with real assemblies, I get 0% code coverage (Note: All tests pass). On demo test for demo source that I created, it worked fine (the report makes sense). I noticed that in log file: for demo files, after line "Assembly AAAAAA loa...

Object Disposed Exception when using .Net Trace Source within VS UNit Tests

I'm getting an Object Disposed Exception when I try to call TraceSource.TraceData with my VS2008 unit test project. I have included a very small code sample below which consistently repros the issue. I'm only seeing this after I run my first unit test - but I have a hunch it'll affect me once my website is up and running with lots of u...

Running MSTEST.exe /publish on a TeamBuild server, what are the prerequisites?

Similarly to http://stackoverflow.com/questions/954943/how-to-use-mstest-in-continous-integration-without-vs, I want to run mstest.exe on a TeamBuild server. My context is http://stackoverflow.com/questions/1059230/trapping-error-status-in-msbuild/1059672#1059672 - i.e., I'm only trying to use mstest.exe /publish to upload the results i...

Test Projects Display as Folder only in VS2008 on 1 machine

I have some projects that I created on my laptop, and they work fine there. I have just added them to the Subversion repository on my home PC, and loaded in VS on that PC only to find that the test projects do not display; they just show as a folder icon, and you can't see anything under the root. There is an expand icon next to the fold...

What advantages/disadvantages do MSTest and NUnit have compared to each other?

Since Microsoft created MSTest, I've been using it for unit testing. I never really used NUnit, and I just didn't like the need to have yet another tool installed on my dev box. I've only used the basic features of MSTest so far, and they have satisfied my needs, and I don't really know anything about NUnit. Could someone list out some ...

MSTest & CruiseControl.Net

I am trying to get MSTest working with CruiseControl.Net. I currently have it working prefectly for unit tests, but I would like to see my code coverage. When I run MSTest and export it to an XML file (using /resultsfile:"C:\output\results.xml") it seems that no Coverage information is exported. However when I run MS test and open the re...

Unit Testing Adding to Zip / Extracting from Zip

I have the following code for adding to/extracting from Zip. I'm trying to refactor this to make it test-ready. Can someone provide pointers on how I can accomplish this? Aside: I'm using Moq as my mock framework and MSTest as my Unit Testing tool private const long BufferSize = 4096; public static void ExtractZip(string zipFilename...

MSTEST PrincipalPermission

How do you unit test code decorated with the PrincipalPermission attribute? For example, this works: class Program { static void Main(string[] args) { AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); var c = new MyClass(); } } [PrincipalPermission(SecurityAction.Demand, Role =...

Data-driven unit testing - Problem with CSV encoding?

Hi, I have the following CSV file that is used in my data-driven unit test: File;expected Resources.resx;default Resources.de.resx;de AttachmentDetail.ascx.it.resx;it SomeOtherFile.rm-CH.resx;rm-CH "File" and "expected" are the header. But if I want to get the "File"-column in the code like TestContext.DataRow["File"].ToString(); ...

VS2008 UnitTesting - detached RCW with Office Application objects (PowerPoint, etc.)

BACKGROUND I am automating an PowerPoint 2007 via C# I am writing unittests using the built-in unit testing of Visual Studio (Microsoft.VisualStudio.TestTools.UnitTesting) for my code I am well relatively experienced in automating the Office 2007 apps MY PROBLEM When I run my unit tests, the first unit test method runs fine, all af...

Is it Possible to have Dynamic - On-The-Fly DeploymentItems?

I want to write tests to check the existance (and other stuff) of certain files that will be shipped with our project. This is what I have right now: [DeploymentItem("1.pdf")] [DeploymentItem("2.pdf")] public class DoFilesExist { List<string> _Files; public DoFilesExist() { _Files = new List<string>(); ...

How do I tell MSTEST to run all test projects in a Solution?

I need to know how to tell MSTEST to run all test projects in a solution file. This needs to be done from the command line. Right now I have to pass it a specific project file, I'm trying to get it to run from a SOLUTION file. I'm hoping this is possible, because in Visual Studio, hitting Ctrl+R, A, runs ALL tests in the currently ope...

ExpectedExceptionAttribute is not working in MSTest

This is wierd, but all of a sudden the `ExpectedExceptionAttribute' quit working for me the other day. Not sure what's gone wrong. I'm running VS 2010 and VS 2005 side-by-side. It's not working in VS 2010. This test should pass, however it is failing: [TestMethod] [ExpectedException(typeof(ArgumentNullException))] public voi...

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

Dear ladies and sirs. 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 different implementations of the same interface. From my past experien...

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

Dear ladies and sirs. 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 tests running against the same DataSource. I also like experimenting ...

Convert C# Library To MSTest Project

I have some class libraries with NUnit tests, and I want to convert the project to use the VS 2008 MsTest integration. (Right click add test etc.) Is there and easy way to convert or do I need to edit the csproj manually. Thanks ...

Getting MSTest output to show in CruiseControl.Net

I currently have our build server set up with CruiseControl.Net running a build using MSBuild and then running unit tests using MSTest. The problem is I can't see the output of the unit tests in CC - I know they are being run because I can get the build to fail if I commit a failing test. I have followed the online guides from http://bl...

Trace in Visual Studio Testing (Migrating from NUnit)

In NUnit, I'm used to writing Trace statements in the test, and having them show up in the trace tab of the NUnit gui. On a new project, I'm moving to the built in Unit Testing in Visual Studio Professional Addition, which I believe is an interface to mstest.exe. Test Code: <TestMethod()> Public Sub TestPagesInheritFromBasePage() ...

Web testing frameworks for ASP.NET web application

I'm trying to implement some front end testing in a ASP.NET web application, and I would like to know how do the several web testing frameworks compare. Especially MSTest's "Web Tests", because I haven't seen a lot of info about them, and since it seems to have a nice integration with Visual Studio. Related posts: WatiN or Selenium? Wat...