Last change
on this file since 8624 was 8624, checked in by bastiK, 9 years ago |
add missing svn:eol-style=native
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.hamcrest.CoreMatchers.is;
|
---|
5 | import static org.junit.Assert.assertThat;
|
---|
6 |
|
---|
7 | import java.util.Arrays;
|
---|
8 | import java.util.Collections;
|
---|
9 |
|
---|
10 | import org.junit.BeforeClass;
|
---|
11 | import org.junit.Test;
|
---|
12 | import org.openstreetmap.josm.JOSMFixture;
|
---|
13 | import org.openstreetmap.josm.data.osm.Relation;
|
---|
14 | import org.openstreetmap.josm.data.osm.Way;
|
---|
15 |
|
---|
16 | public class CopyActionTest {
|
---|
17 |
|
---|
18 | @BeforeClass
|
---|
19 | public static void setUpBeforeClass() {
|
---|
20 | JOSMFixture.createUnitTestFixture().init();
|
---|
21 | }
|
---|
22 |
|
---|
23 | @Test
|
---|
24 | public void testCopyStringWay() throws Exception {
|
---|
25 | final Way way = new Way(123L);
|
---|
26 | assertThat(CopyAction.getCopyString(Collections.singleton(way)), is("way 123"));
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Test
|
---|
30 | public void testCopyStringWayRelation() throws Exception {
|
---|
31 | final Way way = new Way(123L);
|
---|
32 | final Relation relation = new Relation(456);
|
---|
33 | assertThat(CopyAction.getCopyString(Arrays.asList(way, relation)), is("way 123,relation 456"));
|
---|
34 | assertThat(CopyAction.getCopyString(Arrays.asList(relation, way)), is("relation 456,way 123"));
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.