NUnit vs. Visual Studio 2008’s test projects for unit testing [closed]

Daok named all the pro’s of Visual Studio 2008 test projects. Here are the pro’s of NUnit. NUnit has a mocking framework. NUnit can be run outside of the IDE. This can be useful if you want to run tests on a non-Microsoft build server, like CruiseControl.NET. NUnit has more versions coming out than visual studio. You … Read more

Compare equality between two objects in NUnit

Do not override Equals just for testing purposes. It’s tedious and affects domain logic. Instead, Use JSON to compare the object’s data No additional logic on your objects. No extra tasks for testing. Just use this simple method: public static void AreEqualByJson(object expected, object actual) { var serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); var expectedJson = serializer.Serialize(expected); … Read more

NUnit isn’t running Visual Studio 2010 code

I’ve downloaded the NUnit 2.5 source and opened the VS2008 solution in the VS2010 beta. Once the conversion finished I opened all the projects and changed the target framework setting for all the projects to “.NET Framework 4.0”. I then built the solution without any errors. I can now use the NUnit GUI app to … Read more

How can we run a test method with multiple parameters in MSTest?

EDIT 4: Looks like this is completed in MSTest V2 June 17, 2016: https://blogs.msdn.microsoft.com/visualstudioalm/2016/06/17/taking-the-mstest-framework-forward-with-mstest-v2/ Original Answer: As of about a week ago in Visual Studio 2012 Update 1 something similar is now possible: [DataTestMethod] [DataRow(12,3,4)] [DataRow(12,2,6)] [DataRow(12,4,3)] public void DivideTest(int n, int d, int q) { Assert.AreEqual( q, n / d ); } EDIT: It … Read more

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

I know this is an old thread, but I thought I’d post a vote for xUnit.NET. While most of the other testing frameworks mentioned are all pretty much the same, xUnit.NET has taken a pretty unique, modern, and flexible approach to unit testing. It changes terminology, so you no longer define TestFixtures and Tests…you specify … Read more