forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -28,7 +28,6 @@ import org.junit.Test;
|
|||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.chart.ChartView;
|
import de.dennisguse.opentracks.chart.ChartView;
|
||||||
import de.dennisguse.opentracks.content.data.Distance;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link ChartFragment}.
|
* Tests {@link ChartFragment}.
|
||||||
@@ -59,7 +58,6 @@ public class ChartFragmentTest {
|
|||||||
boolean chartByDistance = false;
|
boolean chartByDistance = false;
|
||||||
chartFragment = ChartFragment.newInstance(chartByDistance);
|
chartFragment = ChartFragment.newInstance(chartByDistance);
|
||||||
chartFragment.setChartView(new ChartView(ApplicationProvider.getApplicationContext(), chartByDistance));
|
chartFragment.setChartView(new ChartView(ApplicationProvider.getApplicationContext(), chartByDistance));
|
||||||
chartFragment.setRecordingDistanceInterval(Distance.of(50));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+6
@@ -13,6 +13,7 @@ import androidx.test.rule.GrantPermissionRule;
|
|||||||
import androidx.test.rule.ServiceTestRule;
|
import androidx.test.rule.ServiceTestRule;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
@@ -64,6 +65,11 @@ public class TrackRecordingServiceTestLocation {
|
|||||||
if (Looper.myLooper() == null) Looper.prepare();
|
if (Looper.myLooper() == null) Looper.prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void finalTearDown() {
|
||||||
|
if (Looper.myLooper() != null) Looper.myLooper().quit();
|
||||||
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws TimeoutException {
|
public void setUp() throws TimeoutException {
|
||||||
// Set up the mock content resolver
|
// Set up the mock content resolver
|
||||||
|
|||||||
@@ -76,4 +76,9 @@ public class ChartPoint {
|
|||||||
public Double getPower() {
|
public Double getPower() {
|
||||||
return power;
|
return power;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ChartPoint{" + "timeOrDistance=" + timeOrDistance + '}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,24 +318,4 @@ public class ChartFragment extends Fragment implements TrackDataListener {
|
|||||||
void setChartView(ChartView view) {
|
void setChartView(ChartView view) {
|
||||||
chartView = view;
|
chartView = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
void setMetricUnits(boolean value) {
|
|
||||||
chartView.setMetricUnits(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
void setReportSpeed(boolean value) {
|
|
||||||
chartView.setReportSpeed(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
void setChartByDistance(boolean value) {
|
|
||||||
chartByDistance = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
void setRecordingDistanceInterval(Distance value) {
|
|
||||||
recordingDistanceInterval = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user