Test Review #3 – Unity

By Roy Osherove In .NET, Agile, Art Of Unit Testing, TestReview, Testing Guidelines, Unit Testing

Markdown version

Historical article · Originally published March 22, 2009; technical details may be outdated.

Watch previous videos:

//TestReviewUnity.mp4

In this video I go over the tests for Microsoft Unity Application Block.

Overall the quality of the tests in Unity is pretty good! I could certainly recommend that people look at them as examples of a bunch of tests against a framework, which are mostly very readable and maintainable.

Things I walk through:

  • Using [Ignore]
  • exploration testing
  • magic numbers and strings
  • un-needed asserts
  • Stub hard coded behavior
  • handling config files in tests
  • Asserts hidden in a utility method
  • more naming conventions
  • Separating integration tests
  • “smart” code that is less readable
  • Meaningless “isNotNull” tests
  • cleaner ways of expecting exceptions

Lessons on this topic

More in .NET

All posts in .NET