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

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

cleanup unit tests

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions;
3
4import static org.junit.Assert.assertEquals;
5
6import java.util.Arrays;
7import java.util.Collections;
8
9import org.junit.BeforeClass;
10import org.junit.Test;
11import org.openstreetmap.josm.JOSMFixture;
12import org.openstreetmap.josm.data.osm.Relation;
13import org.openstreetmap.josm.data.osm.Way;
14
15/**
16 * Unit tests for class {@link CopyAction}.
17 */
18public class CopyActionTest {
19
20 /**
21 * Setup test.
22 */
23 @BeforeClass
24 public static void setUpBeforeClass() {
25 JOSMFixture.createUnitTestFixture().init();
26 }
27
28 /**
29 * Test of {@link CopyAction#getCopyString} method for a single way.
30 */
31 @Test
32 public void testCopyStringWay() {
33 final Way way = new Way(123L);
34 assertEquals("way 123", CopyAction.getCopyString(Collections.singleton(way)));
35 }
36
37 /**
38 * Test of {@link CopyAction#getCopyString} method for a way and a relation.
39 */
40 @Test
41 public void testCopyStringWayRelation() {
42 final Way way = new Way(123L);
43 final Relation relation = new Relation(456);
44 assertEquals("way 123,relation 456", CopyAction.getCopyString(Arrays.asList(way, relation)));
45 assertEquals("relation 456,way 123", CopyAction.getCopyString(Arrays.asList(relation, way)));
46 }
47}
Note: See TracBrowser for help on using the repository browser.