Changeset 15352 in josm for trunk/test/unit


Ignore:
Timestamp:
2019-09-15T23:54:42+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #18130 - Select next image after remove (patch by francois2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/ImageDataTest.java

    r15348 r15352  
    196196
    197197    @Test
     198    public void testSelectImageAfterRemove() {
     199        List<ImageEntry> list = getOneImage();
     200        list.add(new ImageEntry());
     201
     202        ImageData data = new ImageData(list);
     203        data.selectFirstImage();
     204        data.removeSelectedImages();
     205        assertEquals(1, data.getImages().size());
     206        assertEquals(1, data.getSelectedImages().size());
     207        assertEquals(list.get(0), data.getSelectedImages().get(0));
     208    }
     209
     210    @Test
     211    public void testSelectImageAfterRemoveWhenTheLastIsSelected() {
     212        List<ImageEntry> list = getOneImage();
     213        list.add(new ImageEntry());
     214
     215        ImageData data = new ImageData(list);
     216        data.selectLastImage();
     217        data.removeSelectedImages();
     218        assertEquals(1, data.getImages().size());
     219        assertEquals(1, data.getSelectedImages().size());
     220        assertEquals(list.get(0), data.getSelectedImages().get(0));
     221    }
     222
     223    @Test
    198224    public void testRemoveSelectedImageTriggerListener() {
    199225        List<ImageEntry> list = getOneImage();
Note: See TracChangeset for help on using the changeset viewer.