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.Rule;
|
---|
7 | import org.junit.Test;
|
---|
8 | import org.openstreetmap.josm.data.osm.Tag;
|
---|
9 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
10 |
|
---|
11 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Unit tests of {@link ReverseWayNoTagCorrector} class.
|
---|
15 | */
|
---|
16 | public class ReverseWayNoTagCorrectorTest {
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Setup test.
|
---|
20 | */
|
---|
21 | @Rule
|
---|
22 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
23 | public JOSMTestRules test = new JOSMTestRules();
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Tests the {@link ReverseWayNoTagCorrector#getDirectionalTags} function
|
---|
27 | */
|
---|
28 | @Test
|
---|
29 | public void testDirectionalTags() {
|
---|
30 | assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("waterway", "drain")).size());
|
---|
31 | assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("man_made", "embankment")).size());
|
---|
32 | assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "drag_lift")).size());
|
---|
33 | assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "station")).size());
|
---|
34 | assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("incline", "up")).size());
|
---|
35 | assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("oneway", "yes")).size());
|
---|
36 | }
|
---|
37 | }
|
---|