1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.corrector;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertEquals;
|
---|
5 |
|
---|
6 | import org.junit.BeforeClass;
|
---|
7 | import org.junit.Test;
|
---|
8 | import org.openstreetmap.josm.JOSMFixture;
|
---|
9 | import org.openstreetmap.josm.data.osm.Tag;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Unit tests of {@link ReverseWayNoTagCorrector} class.
|
---|
13 | */
|
---|
14 | public class ReverseWayNoTagCorrectorTest {
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Setup test.
|
---|
18 | */
|
---|
19 | @BeforeClass
|
---|
20 | public static void setUp() {
|
---|
21 | JOSMFixture.createUnitTestFixture().init();
|
---|
22 | }
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Tests the {@link ReverseWayNoTagCorrector#getDirectionalTags} function
|
---|
26 | */
|
---|
27 | @Test
|
---|
28 | public void testDirectionalTags() {
|
---|
29 | assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("waterway", "drain")).size());
|
---|
30 | assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("man_made", "embankment")).size());
|
---|
31 | assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "cable_car")).size());
|
---|
32 | assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "station")).size());
|
---|
33 | assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("incline", "up")).size());
|
---|
34 | assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("oneway", "yes")).size());
|
---|
35 | }
|
---|
36 | }
|
---|