How many unit tests should I write per function/method?

One test per check and super descriptive names, per instance:

@Test
public void userCannotVoteDownWhenScoreIsLessThanOneHundred() {
 ...
}

Both only one assertion and using good names gives me a better report when a test fails. They scream to me: “You broke THAT rule!”.

Leave a Comment