@Test public void getCsvLine_LocationWithHdopPdopVdop_ReturnsCSVLine(){ CSVFileLogger plain = new CSVFileLogger(null,null); Location loc = MockLocations.builder("MOCK", 12.1930017, 19.1115127).withAltitude(101).withAccuracy(41).withBearing(119).withSpeed(9) .putExtra("satellites",7) .putExtra(BundleConstants.HDOP, "LOOKATTHISHDOP!") .build(); String actual = plain.getCsvLine(loc,"2011-09-17T18:45:33Z"); String expected = "2011-09-17T18:45:33Z,12.1930017,19.1115127,101.0,41.0,119.0,9.0,7,MOCK,LOOKATTHISHDOP!,,,,,,,,\n"; assertThat("CSV line with HDOP", actual, is(expected)); Location loc2 = MockLocations.builder("MOCK", 12.193, 19.111).withAltitude(101).withAccuracy(41).withBearing(119).withSpeed(9) .putExtra("satellites",7) .putExtra(BundleConstants.HDOP, "LOOKATTHISHDOP!") .putExtra(BundleConstants.VDOP, "392.13") .putExtra(BundleConstants.PDOP, "Papepeodpe") .build(); actual = plain.getCsvLine(loc2,"2011-09-17T18:45:33Z"); expected = "2011-09-17T18:45:33Z,12.193,19.111,101.0,41.0,119.0,9.0,7,MOCK,LOOKATTHISHDOP!,392.13,Papepeodpe,,,,,,\n"; assertThat("CSV line with HDOP PDOP VDOP", actual, is(expected)); }
String getCsvLine(Location loc, String dateTimeString) { return getCsvLine("", loc, dateTimeString); }
CSVFileLogger implements FileLogger { String getCsvLine(Location loc, String dateTimeString) { return getCsvLine("", loc, dateTimeString); } }
CSVFileLogger implements FileLogger { String getCsvLine(Location loc, String dateTimeString) { return getCsvLine("", loc, dateTimeString); } CSVFileLogger(File file, @Nullable Integer batteryLevel); }
CSVFileLogger implements FileLogger { String getCsvLine(Location loc, String dateTimeString) { return getCsvLine("", loc, dateTimeString); } CSVFileLogger(File file, @Nullable Integer batteryLevel); @Override void write(Location loc); @Override void annotate(String description, Location loc); @Override String getName(); }
CSVFileLogger implements FileLogger { String getCsvLine(Location loc, String dateTimeString) { return getCsvLine("", loc, dateTimeString); } CSVFileLogger(File file, @Nullable Integer batteryLevel); @Override void write(Location loc); @Override void annotate(String description, Location loc); @Override String getName();  }