forked from upstream-mirrors/OpenTracks
Finally solved instanceof class test. Its ready to merge?
This commit is contained in:
+2
-4
@@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.maps;
|
package com.google.android.apps.mytracks.maps;
|
||||||
|
|
||||||
import static com.google.android.testing.mocking.AndroidMock.expect;
|
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.Constants;
|
import com.google.android.apps.mytracks.Constants;
|
||||||
import com.google.android.apps.mytracks.MockPath;
|
import com.google.android.apps.mytracks.MockPath;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
@@ -58,7 +56,7 @@ public class TrackPathPainterFactoryTest extends TrackPathPainterTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <T> void testTrackPathPainterFactorySpecific(Context context, SharedPreferences prefs,
|
private <T> void testTrackPathPainterFactorySpecific(Context context, SharedPreferences prefs,
|
||||||
int track_color_mode, Class <? extends TrackPathPainter> classtested) {
|
int track_color_mode, Class <?> c) {
|
||||||
prefs.edit().putString(context.getString(track_color_mode),
|
prefs.edit().putString(context.getString(track_color_mode),
|
||||||
context.getString(R.string.track_color_mode_key)).commit();
|
context.getString(R.string.track_color_mode_key)).commit();
|
||||||
|
|
||||||
@@ -68,7 +66,7 @@ public class TrackPathPainterFactoryTest extends TrackPathPainterTestCase {
|
|||||||
TrackPathPainter painter = TrackPathPainterFactory.getTrackPathPainter(context);
|
TrackPathPainter painter = TrackPathPainterFactory.getTrackPathPainter(context);
|
||||||
|
|
||||||
assertNotNull(painter);
|
assertNotNull(painter);
|
||||||
expect(classtested.isInstance(painter));
|
assertTrue(c.isInstance(painter));
|
||||||
|
|
||||||
painter.updatePath(myTracksOverlay.getMapProjection(mockView),
|
painter.updatePath(myTracksOverlay.getMapProjection(mockView),
|
||||||
myTracksOverlay.getMapViewRect(mockView), startLocationIdx, alwaysVisible,
|
myTracksOverlay.getMapViewRect(mockView), startLocationIdx, alwaysVisible,
|
||||||
|
|||||||
Reference in New Issue
Block a user