179
votes
8answers
41k views

NUnit vs. MbUnit vs. MSTest vs. xUnit.net [closed]

There are quite a lot of unittesting frameworks out there for .NET. I found this little feature comparison: http://xunit.codeplex.com/wikipage?title=Comparisons Now I am to choose the best one for ...
91
votes
4answers
3k views

Why does this assert throw a format exception when comparing structures?

I'm trying to assert the equality of two System.Drawing.Size structures, and I'm getting a format exception instead of the expected assert failure. [TestMethod] public void AssertStructs() { var ...
75
votes
6answers
22k views

How can I get “Copy to Output Directory” to work with Unit Tests?

When I build a unit test project before the tests are executed the test output is copied to a TestResults folder and then the tests are executed. The issue I'm having is that not all the files in the ...
68
votes
14answers
14k views

VS 2010 Test Runner error “The agent process was stopped while the test was running.”

In Visual Studio 2010, I have a number of unit tests. When I run multiple tests at one time using test lists, I sometimes reveive the following error for one or more of the tests: The agent ...
48
votes
4answers
9k views

Do MSTest deployment items only work when present in the project test settings file?

I can't seem to grasp how MSTest deployment items are supposed to be configured. I have been able to get them working properly by modifying the project's test settings file, but this is less then ...
45
votes
11answers
21k views

Problems with DeploymentItem attribute

I'm currently maintaining an "old" system written in C#.net, removing some obsolete features and doing some refactoring. Thanks god, the previous guy wrote some unit tests (MSTests). I quite ...
37
votes
2answers
6k views

Visual Studio 2010 does not discover new unit tests

I am writing some unit tests in Visual Studio 2010. I can run all tests by using "Run all Tests in Current Context". However, if I write a new unit test, it does not get picked up by the environment ...
36
votes
12answers
24k views

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

I have a c# solution with the following structure: mySolution myProject myProject.MSTests References Microsoft.VisualStudio.QualityTools.UnitTestFramework sutMSTests.cs ...
26
votes
5answers
3k views

How to RowTest with MSTest?

I know that MSTest doesn't support RowTest and similar tests. What MSTests users do? How is it possible to live without RowTest support? I've seen DataDriven test features but sounds like too much ...
22
votes
3answers
4k views

CollectionAssert use with generics?

It appears that CollectionAssert cannot be used with generics. This is super frustrating; the code I want to test does use generics. What am I to do? Write boilerplate to convert between the two? ...
22
votes
2answers
3k views

How to set up LocalDb for unit tests in Visual Studio 2012 and Entity Framework 5

We have a Visual Studio 2012 ASP.NET MVC project using Entity Framework 5. There are some unit tests that depend on a database. Setting up the app.config file in the test project to use a central SQL ...
21
votes
5answers
14k views

Getting PartCover to work

I want to try PartCover for code coverage. I'm running Visual Studio 2008 Professional with MSTest. The Professional Edition does not include the Team Testing tools, like Code Coverage. So, I'm ...
20
votes
4answers
15k views

How does Assert.AreEqual determine equality between two generic IEnumerables?

I have a unit test that will test to see if a method that returns the correct IEnumerable. The method builds the IEnumerable using yield return. The class that it is an IEnumerable of is below: ...
20
votes
6answers
8k views

Unit Testing: DateTime.Now

I have some unit tests that expects the 'current time' to be different than DateTime.Now and I don't want to change the computer's time, obviously. What's the best strategy to achieve this? Thanks
20
votes
6answers
16k views

How do I use MSTest without Visual Studio?

Does MSTest have standalone GUI similar to nUnit that lets me use it and run test without visual studio? What is the official site for MSTest where I can learn more about how to use it?

1 2 3 4 5 37
15 30 50 per page