Search in sources :

Example 61 with OsmLatLon

use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.

the class CreateNoteDaoTest method testAddGetDelete.

public void testAddGetDelete() {
    CreateNote note = new CreateNote();
    note.text = "text";
    note.questTitle = "title";
    note.position = new OsmLatLon(3, 5);
    note.elementId = 123L;
    note.elementType = Element.Type.NODE;
    note.imagePaths = new ArrayList<>();
    note.imagePaths.add("hullo");
    note.imagePaths.add("hey");
    assertTrue(dao.add(note));
    CreateNote dbNote = dao.get(note.id);
    assertEquals(note.text, dbNote.text);
    assertEquals(note.questTitle, dbNote.questTitle);
    assertEquals(note.id, dbNote.id);
    assertEquals(note.position, dbNote.position);
    assertEquals(note.elementType, dbNote.elementType);
    assertEquals(note.elementId, dbNote.elementId);
    assertEquals(note.imagePaths, dbNote.imagePaths);
    assertTrue(dao.delete(note.id));
    assertNull(dao.get(note.id));
}
Also used : OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon)

Aggregations

OsmLatLon (de.westnordost.osmapi.map.data.OsmLatLon)61 LatLon (de.westnordost.osmapi.map.data.LatLon)33 ArrayList (java.util.ArrayList)24 BoundingBox (de.westnordost.osmapi.map.data.BoundingBox)9 ElementGeometry (de.westnordost.streetcomplete.data.osm.ElementGeometry)9 Date (java.util.Date)8 List (java.util.List)8 OsmQuest (de.westnordost.streetcomplete.data.osm.OsmQuest)7 Note (de.westnordost.osmapi.notes.Note)6 OsmNode (de.westnordost.osmapi.map.data.OsmNode)5 TestQuestType (de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType)5 Element (de.westnordost.osmapi.map.data.Element)4 TestQuestType2 (de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType2)4 Node (de.westnordost.osmapi.map.data.Node)3 NoteComment (de.westnordost.osmapi.notes.NoteComment)3 HashMap (java.util.HashMap)3 Point (android.graphics.Point)2 Rect (android.graphics.Rect)2 LongSparseArray (android.util.LongSparseArray)2 QuestGroup (de.westnordost.streetcomplete.data.QuestGroup)2