[Right]-BICEP: Are the Results Right?
Learn if the tests we write give the correct results.
We'll cover the following...
Our tests should first validate that the code produces the expected results. The arithmetic-mean test below demonstrates that the ScoreCollection
class produces the correct mean of 6
given the numbers 5
and 7
.
@Test
public void answersArithmeticMeanOfTwoNumbers() {
ScoreCollection collection = new ScoreCollection();
collection.add(() -> 5);
collection.add(() -> 7);
int actualResult =
...