use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.
the class CreateNoteDaoTest method testGetAll.
public void testGetAll() {
CreateNote note1 = new CreateNote();
note1.text = "this is in";
note1.position = new OsmLatLon(0.5, 0.5);
dao.add(note1);
CreateNote note2 = new CreateNote();
note2.text = "this is out";
note2.position = new OsmLatLon(-0.5, 0.5);
dao.add(note2);
assertEquals(1, dao.getAll(new BoundingBox(0, 0, 1, 1)).size());
assertEquals(2, dao.getAll(null).size());
}
use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.
the class CreateNoteDaoTest method testCountSeveral.
public void testCountSeveral() {
CreateNote note1 = new CreateNote();
note1.position = new OsmLatLon(0.5, 0.5);
note1.text = "joho";
dao.add(note1);
CreateNote note2 = new CreateNote();
note2.position = new OsmLatLon(0.1, 0.5);
note2.text = "hey";
dao.add(note2);
assertEquals(2, dao.getCount());
}
use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.
the class NoteDaoTest method createNote.
static Note createNote() {
Note note = new Note();
note.position = new OsmLatLon(1, 1);
note.status = Note.Status.OPEN;
note.id = 5;
note.dateCreated = new Date(5000);
NoteComment comment = new NoteComment();
comment.text = "hi";
comment.date = new Date(5000);
comment.action = NoteComment.Action.OPENED;
comment.user = new User(5, "PingPong");
note.comments.add(comment);
return note;
}
use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.
the class OsmNoteQuestDaoTest method testGetPositions.
public void testGetPositions() {
Note note = NoteDaoTest.createNote();
note.position = new OsmLatLon(34, 35);
noteDao.put(note);
OsmNoteQuest quest = new OsmNoteQuest(note, questType);
dao.add(quest);
List<LatLon> positions = dao.getAllPositions(new BoundingBox(0, 0, 50, 50));
assertEquals(1, positions.size());
assertEquals(new OsmLatLon(34, 35), positions.get(0));
}
use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.
the class RoadNameSuggestionsDaoTest method createRoadPositions.
private static ArrayList<LatLon> createRoadPositions() {
ArrayList<LatLon> roadPositions = new ArrayList<>();
roadPositions.add(new OsmLatLon(0, 0));
roadPositions.add(new OsmLatLon(0, 0.0001));
return roadPositions;
}
Aggregations