What is equivalent to JUnit in C #?

I come from Java and am currently working on a C # project. What is the recommended way: a) test existing C # code and b) perform TDD to develop C #?

There is also the equivalent of EMMA / EclEmma (a free but powerful code coverage tool) for Visual Studio and C # code?

+6
c # unit-testing junit
source share
10 answers

1 Nunit
2 NCover or
3 PartCover (I never used it)

+18
source share

NUnit has a pattern after JUnit, but if you are using Visual Studio 2008, consider the built-in unit testing system.

+9
source share

Unit test framework: NUnit

Unit test runner: Different, but I personally like the one in ReSharper . (ReSharper costs money, but it is easily worth it for various performance improvements.)

Scope: NCover (I think it was free, but now it costs money. Hmm.)

+6
source share

I would highly recommend Gallio (formally mbUnit) for unit testing and (unfortunately not free) NCover for code coverage.

+4
source share

Regarding your question about unit test structures:

NUnit 1.0 was a direct port to JUnit. NUnit 2.0 moved away from JUnit syntax to take advantage of the .NET platform. xUnit.net is a new unit test framework (from Jim Newkirk, one of the developers of NUnit 2.0 and Brad Wilson), which claims to have a goal that demonstrates "achievements in other implementations of the unit test library that did not actually appear in .NET" which I read as "not far behind JUnit".

+3
source share
+2
source share

NUnit, but NCover is only part of the answer as it is not free. I asked elsewhere about this.

+2
source share

VS2008 Professional has the functionality of testing the Team System module.

+2
source share

NUnit for sure.

+2
source share

I would install:

As an aside, it seems strange to me that the NUnit guys seem to be using php to host their homepage ...

+1
source share

All Articles