mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 17:43:06 +02:00
Cleanup.
This commit is contained in:
@@ -28,7 +28,6 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import de.dennisguse.opentracks.chart.ChartView;
|
||||
import de.dennisguse.opentracks.content.data.Distance;
|
||||
|
||||
/**
|
||||
* Tests {@link ChartFragment}.
|
||||
@@ -59,7 +58,6 @@ public class ChartFragmentTest {
|
||||
boolean chartByDistance = false;
|
||||
chartFragment = ChartFragment.newInstance(chartByDistance);
|
||||
chartFragment.setChartView(new ChartView(ApplicationProvider.getApplicationContext(), chartByDistance));
|
||||
chartFragment.setRecordingDistanceInterval(Distance.of(50));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+6
@@ -13,6 +13,7 @@ import androidx.test.rule.GrantPermissionRule;
|
||||
import androidx.test.rule.ServiceTestRule;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
@@ -64,6 +65,11 @@ public class TrackRecordingServiceTestLocation {
|
||||
if (Looper.myLooper() == null) Looper.prepare();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void finalTearDown() {
|
||||
if (Looper.myLooper() != null) Looper.myLooper().quit();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws TimeoutException {
|
||||
// Set up the mock content resolver
|
||||
|
||||
@@ -76,4 +76,9 @@ public class ChartPoint {
|
||||
public Double getPower() {
|
||||
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) {
|
||||
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