unit-testing From simple to complex


Same as, with writing classes - start with the simple cases, then add requirement (aka tests) and implementation (aka production code) case by case:

public void EnsureThat_IsLeapYearIfDecimalMultipleOf4() {...}
public void EnsureThat_IsNOTLeapYearIfDecimalMultipleOf100 {...}
public void EnsureThat_IsLeapYearIfDecimalMultipleOf400 {...}

Don't forget the refactoring step, when finished with requirements - first refactor the code, then refactor the tests

When finished, you should have a complete, up to date and READABLE documentation of your class.