I watched the review of the unit tests of the ASP.NET MVC framework done by Roy Osherove and it was interesting. It’s great to have someone going through unit tests and explaining what they done right or wrong.
Here is some points he made in the review:
- No dynamic values in assert.
- Empty string tests.
- Emphasis on readability.
- Multiple assert on one test is bad.
- Only one mock object per test.
- Verify only what you need to.
- Mocks that should be stubs.
Watch it yourself on the Roy Osherove blog.