Hi,
I'm having problems with week 9 exercise 20.
The same problem has been reported: 10/29/15 by sander there were comments but not solution.
I'll rephrase the question below:
1) Error reported:
FAIL: SensorsAndTemperatureMeasurementTest averageSensorMethodMeasurementsWorks
Returned list should be empty with code
AverageSensor ka = new AverageSensor();
ka.addSensor( new ConstantSensor(3) );
ka.addSensor( new ConstantSensor(7) );
ka.readings();
2) Error analysis:
It seams that the TEST CASE expects ConstantSensor not to be added to the AverageSensor. However this requirement is not mentioned anywhere in the exercise. The only reference as to when the readings returned list should be empty is this: "If the measure method is called when the average sensor is off, or if the average sensor was not added any sensor, the method throws anIllegalStateException."
In the above TEST CASE the there is no indication that any sensor is off. At least one needs to be of in order for average sensor to be off. It seem that the TEST CASE itself is wrong.
3) QUESTION: I would appreciate clarification on the TEST CASE above. Why it expects reading list to be empty?
Best regards,
Ivana