You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update CarsAssembleTest.java
Tests for Task 1 used a boolean comparison to determine whether tests pass. Replaced those with more idiomatic assertEquals(double, double, epsilon) form.
When the new style of test fails the user is shown the expected value and the actual value:
Expected :1591.2
Actual :1989.0
The previous implementation showed the user the less clear: Expected :true
Actual :false
The test implementation being replaced required the comparison to be strictly less than epsilon, not inclusive of epsilon. The JUnit assertEquals replacement check is inclusive of epsilon.
OLD: Math.abs(value1 - value2) < epsilon)
NEW: Math.abs(value1 - value2) <= epsilon
Given an epsilon of 0.0000001d this is unlikely to see any existing solutions fail given the expected answers only check the tenths place.
* Update CarsAssembleTest.java
Use AssertJ isCloseTo style assertion instead of JUnit assertEquals.
0 commit comments