aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/activity/waypoint/AbstractEditWaypointActivityTest.java
blob: bf8224acacb1ae9b014da9a204cc0b5835ed432c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cgeo.geocaching.activity.waypoint;

import cgeo.geocaching.EditWaypointActivity_;
import cgeo.geocaching.Waypoint;
import cgeo.geocaching.enumerations.WaypointType;

public abstract class AbstractEditWaypointActivityTest extends AbstractWaypointActivityTest {
    private Waypoint waypoint;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        createWaypoint();
        getCache().addOrChangeWaypoint(waypoint, true);
        final int waypointId = getCache().getWaypoints().get(0).getId();
        setActivityIntent(new EditWaypointActivity_.IntentBuilder_(getInstrumentation().getContext()).geocode(getCache().getGeocode()).waypointId(waypointId).get());
        getActivity();
    }

    private void createWaypoint() {
        waypoint = new Waypoint("Test waypoint", WaypointType.PUZZLE, true);
        waypoint.setNote("Test note");
    }

    protected final Waypoint getWaypoint() {
        return waypoint;
    }
}