use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange in project StreetComplete by westnordost.
the class OsmQuestChangesUploadTest method createAnsweredQuestWithNonAppliableChange.
private static OsmQuest createAnsweredQuestWithNonAppliableChange() {
StringMapEntryChange nonPossibleChange = new StringMapEntryDelete("somekey", "value");
StringMapChanges changes = new StringMapChanges(Collections.singletonList(nonPossibleChange));
return createAnsweredQuest(changes);
}
use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange in project StreetComplete by westnordost.
the class AOsmElementQuestTypeTest method verify.
protected final void verify(StringMapEntryChange... expectedChanges) {
StringMapChangesBuilder cb = new StringMapChangesBuilder(tags);
createQuestType().applyAnswerTo(bundle, cb);
List<StringMapEntryChange> changes = cb.create().getChanges();
for (StringMapEntryChange expectedChange : expectedChanges) {
assertTrue(changes.contains(expectedChange));
}
}
use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange 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);
}
use of de.westnordost.streetcomplete.data.osm.changes.StringMapEntryChange 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);
}
Aggregations