mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-30 16:19:56 +08:00
Add rounding test
This commit is contained in:
parent
295144ad42
commit
b2a027742e
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user