views:

123

answers:

4

For those of us who like to learn by reading good code, what are some of the projects you've seen which provide a great example of a medium to large suite of unit tests in action?

This isn't a question about what your favourite unit testing framework is, but it could be helpful to add which unit testing and/or mocking frameworks are used by the projects you mention.

Any platform will do, but I'm mainly interested in projects which use an xUnit-style unit testing framework in .NET.

A: 

For example, ReportLab uses Python's unittest module (also known as PyUnit) and has lots unit test that you might want to take a look at.

I'm also using unittest myself. It is very similar to Java's jUnit framework and thus very handy for writing tests in no time.

AndiDog
A: 

The Service Factory has about 780 unit tests, including some that test code meant to run inside of Visual Studio. It has some very good examples of mocking such code.

The Enterprise Library has even more.

John Saunders
A: 

NunitLite has a unit tests suite but I'm not sure it qualifies as a medium-sized project. I seem to remember NUnit also has unit tests, but its site currently is unavailable.

philippe
+1  A: 

Apache CXF has a mind-numbingly large array of unit tests. They are written to Junit, and include the JUnit-Spring mechanisms as well as one of the mock libraries. They include launching processes and many other mechanisms you might need some day.

bmargulies