Reputation: 39030
I am coming from Java and am currently working on a C# project. What is the recommended way to go about a) unit testing existing C# code and b) accomplishing TDD for C# development?
Also is there an equivalent to EMMA / EclEmma (free yet powerful code coverage tool) for Visual Studio and C# code?
Upvotes: 8
Views: 31552
Reputation: 3585
Regarding your question about unit test frameworks:
NUnit 1.0 was a direct port of JUnit. NUnit 2.0 moved away from JUnit syntax in order to take advantage of the .NET platform. xUnit.net is a newer unit test framework (from Jim Newkirk - one of the NUnit 2.0 developers - and Brad Wilson) that states as a goal exposing "advances in other unit test library implementations that have not really surfaced in .NET," which I read as "keeping up with JUnit."
Upvotes: 3
Reputation: 4262
I would highly recommend Gallio (formally mbUnit) for unit testing, and (unfortunately not free) NCover for code coverage.
Upvotes: 4
Reputation: 55760
I'd install:
As and aside I find it odd that the NUnit guys seem to be using php to host their homepage...
Upvotes: 1
Reputation: 1500495
Unit test framework: NUnit
Unit test runner: Various, but personally I like the one in ReSharper. (ReSharper costs money, but is easily worth it for the various productivity improvements.)
Coverage: NCover (I think this used to be free, but it now costs money. Hmm.)
Upvotes: 6
Reputation: 2644
VS2008 Professional has the Team System unit testing functionality baked in.
Upvotes: 2
Reputation: 155662
NUnit, but NCover is only part of the answer as it isn't free. I've asked elsewhere about that.
Upvotes: 2
Reputation: 24017
NUnit is patterned after JUnit, but if you're using Visual Studio 2008 then consider the built-in unit testing framework.
Upvotes: 9