November 2024
Intermediate to advanced
300 pages
7h 12m
English
Your zero-based test saved your bacon. Maybe a one-based test can do the same? Write a test that adds one and only one credit score:
| | @Test |
| | void withOneRatingHasEquivalentMean() { |
| | var creditHistory = new CreditHistory(); |
| | creditHistory.add(new CreditRating(780)); |
| | var result = creditHistory.arithmeticMean(); |
| | assertEquals(780, result); |
| | } |
You might have quickly put that test in place by duplicating the zero-based test, adding a line to call creditHistory.add(), and changing the assertion.
Your new test passes. Are you done with it? No. Two critical steps remain:
Read now
Unlock full access