Thursday 25 September 2008

It was worth writing those unit tests...

Simple specification:

If the user is not in the "Admin" role, then buttons x, y, and z are hidden.

You'd have thought that unit tested the presenter/controller for this would be pointless, but it highlighted the fact that I'd hard-coded false for the visibility of one of the buttons.

I think that was worth the five minutes it took to put the tests together.