aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/reports/ReportUtilsTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/reports/ReportUtilsTest.java')
-rw-r--r--test/org/traccar/reports/ReportUtilsTest.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/test/org/traccar/reports/ReportUtilsTest.java b/test/org/traccar/reports/ReportUtilsTest.java
index f4dd88cba..2f785c538 100644
--- a/test/org/traccar/reports/ReportUtilsTest.java
+++ b/test/org/traccar/reports/ReportUtilsTest.java
@@ -22,15 +22,10 @@ public class ReportUtilsTest {
public void testCalculateSpentFuel() {
Position startPosition = new Position();
Position endPosition = new Position();
- Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "-");
- startPosition.setProtocol("meitrack");
- startPosition.set(Position.KEY_FUEL_LEVEL, 0.07);
- endPosition.set(Position.KEY_FUEL_LEVEL, 0.05);
- Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.02 %");
- startPosition.setProtocol("galileo");
- Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.02 %");
- startPosition.setProtocol("noran");
- Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.02 %");
+ Assert.assertNull(ReportUtils.calculateFuel(startPosition, endPosition));
+ startPosition.set(Position.KEY_FUEL_LEVEL, 0.7);
+ endPosition.set(Position.KEY_FUEL_LEVEL, 0.5);
+ Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.2");
}
}