/** Tests the constructors. */ @Test public void constructorTest() { Tag tag1 = new Tag(KEY + '=' + VALUE); Tag tag2 = new Tag(KEY, VALUE); TestUtils.equalsTest(tag1, tag2); }
/** Tests the {@link Tile#equals(Object)} and the {@link Tile#hashCode()} method. */ @Test public void equalsTest() { Tile tile1 = new Tile(TILE_X, TILE_Y, ZOOM_LEVEL); Tile tile2 = new Tile(TILE_X, TILE_Y, ZOOM_LEVEL); Tile tile3 = new Tile(TILE_X, TILE_X, ZOOM_LEVEL); TestUtils.equalsTest(tile1, tile2); Assert.assertFalse(tile1.equals(tile3)); Assert.assertFalse(tile3.equals(tile1)); Assert.assertFalse(tile1.equals(new Object())); }
/** Tests the {@link Tag#equals(Object)} and the {@link Tag#hashCode()} method. */ @Test public void equalsTest() { Tag tag1 = new Tag(KEY, VALUE); Tag tag2 = new Tag(KEY, VALUE); Tag tag3 = new Tag(KEY, KEY); TestUtils.equalsTest(tag1, tag2); Assert.assertFalse(tag1.equals(tag3)); Assert.assertFalse(tag3.equals(tag1)); Assert.assertFalse(tag1.equals(new Object())); }