Add rounding test

This commit is contained in:
Fuzzlemann 2017-08-14 22:37:58 +02:00
parent 295144ad42
commit b2a027742e
2 changed files with 9 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public class MathUtilsTest {
*
*/
@Test
public void testAverageLong_Collection() {
public void testAverageLongCollection() {
List<Long> l = new ArrayList<>();
double exp = 10;
l.add(0L);
@ -154,4 +154,12 @@ public class MathUtilsTest {
double result = MathUtils.sumDouble(l.stream());
assertTrue(result + "/" + exp, Double.compare(exp, result) == 0);
}
@Test
public void testRoundDouble() {
double exp = 412.5123125123;
double roundedExp = MathUtils.round(exp);
assertTrue("", Double.compare(412.51, roundedExp) == 0);
}
}

View File

@ -20,8 +20,6 @@ import static org.junit.Assert.assertEquals;
public class ComparatorTest {
private Random r = new Random();
@Test
public void testHandlingInfoComparator() {
List<HandlingInfo> test = RandomData.randomHandlingInfo();