Changeset 16574 in josm for trunk/test


Ignore:
Timestamp:
2020-06-08T21:02:37+02:00 (4 years ago)
Author:
simon04
Message:

see #19056 - Add SequenceCommandTest.testWrapIfNeeded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java

    r13079 r16574  
    55import static org.junit.Assert.assertEquals;
    66import static org.junit.Assert.assertFalse;
     7import static org.junit.Assert.assertNotSame;
    78import static org.junit.Assert.assertNull;
     9import static org.junit.Assert.assertSame;
    810import static org.junit.Assert.assertTrue;
    911import static org.junit.Assert.fail;
     
    298300        }
    299301    }
     302
     303    /**
     304     * Test {@link SequenceCommand#wrapIfNeeded}
     305     */
     306    @Test
     307    public void testWrapIfNeeded() {
     308        DataSet ds = new DataSet();
     309        TestCommand command1 = new TestCommand(ds, Collections.<OsmPrimitive>singletonList(testData.existingNode));
     310        TestCommand command2 = new TestCommand(ds, Collections.<OsmPrimitive>singletonList(testData.existingNode2));
     311        assertSame(command1, SequenceCommand.wrapIfNeeded("foo", command1));
     312        assertNotSame(command1, SequenceCommand.wrapIfNeeded("foo", command1, command2));
     313        assertEquals(new SequenceCommand("foo", command1, command2), SequenceCommand.wrapIfNeeded("foo", command1, command2));
     314    }
    300315}
Note: See TracChangeset for help on using the changeset viewer.