Search in sources :

Example 31 with StringMapEntryAdd

use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd in project StreetComplete by westnordost.

the class AddRoadNameTest method testOneName.

public void testOneName() {
    bundle.putStringArray(AddRoadNameForm.NAMES, new String[] { "my name" });
    verify(new StringMapEntryAdd("name", "my name"));
}
Also used : StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd)

Example 32 with StringMapEntryAdd

use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd in project StreetComplete by westnordost.

the class OsmQuestChangesUploadTest method createAnsweredQuestWithAppliableChange.

private static OsmQuest createAnsweredQuestWithAppliableChange() {
    StringMapEntryChange aPossibleChange = new StringMapEntryAdd("somekey", "value");
    StringMapChanges changes = new StringMapChanges(Collections.singletonList(aPossibleChange));
    return createAnsweredQuest(changes);
}
Also used : StringMapEntryChange(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange) StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd) StringMapChanges(de.westnordost.streetcomplete.data.osm.changes.StringMapChanges)

Example 33 with StringMapEntryAdd

use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd in project StreetComplete by westnordost.

the class OsmQuestDaoTest method testAddGetWithChanges.

public void testAddGetWithChanges() {
    List<StringMapEntryChange> changes = new ArrayList<>();
    changes.add(new StringMapEntryAdd("a key", "a value"));
    changes.add(new StringMapEntryDelete("delete this", "key"));
    changes.add(new StringMapEntryModify("modify", "this", "to that"));
    OsmQuest quest = createNewQuest(11, Element.Type.NODE);
    quest.setChanges(new StringMapChanges(changes), "bla");
    addToDaos(quest);
    assertEquals(1, (long) quest.getId());
    OsmQuest dbQuest = dao.get(1);
    checkEqual(quest, dbQuest);
}
Also used : StringMapEntryDelete(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryDelete) StringMapEntryModify(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryModify) StringMapEntryChange(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange) StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd) StringMapChanges(de.westnordost.streetcomplete.data.osm.changes.StringMapChanges) ArrayList(java.util.ArrayList) OsmQuest(de.westnordost.streetcomplete.data.osm.OsmQuest)

Example 34 with StringMapEntryAdd

use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd in project StreetComplete by westnordost.

the class AddBikeParkingCapacityTest method testCapacity.

public void testCapacity() {
    bundle.putInt(AddBikeParkingCapacityForm.BIKE_PARKING_CAPACITY, 10);
    verify(new StringMapEntryAdd("capacity", "10"));
}
Also used : StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd)

Example 35 with StringMapEntryAdd

use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd in project StreetComplete by westnordost.

the class AddBridgeStructureTest method testStructure.

public void testStructure() {
    ArrayList<String> values = new ArrayList<>();
    values.add("arch");
    bundle.putStringArrayList(AddRecyclingTypeForm.OSM_VALUES, values);
    verify(new StringMapEntryAdd("bridge:structure", "arch"));
}
Also used : StringMapEntryAdd(de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd) ArrayList(java.util.ArrayList)

Aggregations

StringMapEntryAdd (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd)51 StringMapChanges (de.westnordost.streetcomplete.data.osm.changes.StringMapChanges)2 StringMapEntryChange (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange)2 ArrayList (java.util.ArrayList)2 OsmQuest (de.westnordost.streetcomplete.data.osm.OsmQuest)1 StringMapEntryDelete (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryDelete)1 StringMapEntryModify (de.westnordost.streetcomplete.data.osm.changes.StringMapEntryModify)1