DRY out tests (exercise 3.5.2)