source: josm/trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java@ 8513

Last change on this file since 8513 was 8509, checked in by Don-vip, 9 years ago

fix many checkstyle violations

File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions;
3
4import static org.hamcrest.CoreMatchers.is;
5import static org.junit.Assert.assertThat;
6
7import java.util.Arrays;
8import java.util.Collections;
9
10import org.junit.BeforeClass;
11import org.junit.Test;
12import org.openstreetmap.josm.JOSMFixture;
13import org.openstreetmap.josm.data.osm.Relation;
14import org.openstreetmap.josm.data.osm.Way;
15
16public 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.