Ignore:
Timestamp:
2015-12-31T01:38:22+01:00 (8 years ago)
Author:
Don-vip
Message:

add more unit tests

File:
1 edited

Legend:

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

    r8917 r9225  
    55import static org.junit.Assert.assertNotNull;
    66import static org.junit.Assert.assertTrue;
     7import nl.jqno.equalsverifier.EqualsVerifier;
     8import nl.jqno.equalsverifier.Warning;
    79
    810import org.junit.BeforeClass;
     
    1315import org.openstreetmap.josm.data.osm.DataSet;
    1416import org.openstreetmap.josm.data.osm.Node;
     17import org.openstreetmap.josm.data.osm.Way;
    1518import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1619
     
    5457        assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon());
    5558    }
     59
     60    /**
     61     * Unit test of methods {@link ConflictAddCommand#equals} and {@link ConflictAddCommand#hashCode}.
     62     */
     63    @Test
     64    public void equalsContract() {
     65        EqualsVerifier.forClass(ConflictAddCommand.class).usingGetClass()
     66            .withPrefabValues(Conflict.class,
     67                    new Conflict<>(new Node(), new Node()), new Conflict<>(new Way(), new Way()))
     68            .withPrefabValues(OsmDataLayer.class,
     69                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     70            .suppress(Warning.NONFINAL_FIELDS)
     71            .verify();
     72    }
    5673}
Note: See TracChangeset for help on using the changeset viewer.