battle.removePropertyChangeListener(listener);
}
@Test
public void testScale() {
Scale scale = new Scale();
assertEquals("default scale should be 0", Double.valueOf(0.0),
scale.getMeter());
assertEquals("default scale should be 0", Integer.valueOf(0),
scale.getPixels());
Double meters = 1.5;
Integer pixels = 150;
scale.setMeter(meters);
scale.setPixels(150);
assertEquals("meters should have changed", meters, scale.getMeter());
assertEquals("pixels should have changed", pixels, scale.getPixels());
Double meters2 = 5.0;
Integer pixels2 = 300;
Double meters3 = null;
Integer pixels3 = null;
Scale scale1 = new Scale(pixels, meters);
Scale scale2 = new Scale(pixels2, meters);
Scale scale3 = new Scale(pixels, meters2);
Scale scale4 = new Scale(pixels3, meters);
Scale scale5 = new Scale(pixels, meters3);
assertTrue("Scale should be equals to itself", scale.equals(scale));
assertTrue("Scale should'nt be equals to null", !scale.equals(null));
assertTrue("Scale should'nt be equals to other object",
!scale.equals(""));
assertTrue("Scale should be equals to a same scale",
scale.equals(scale1));
assertTrue("Scale should be equals to a same scale",
!scale.equals(scale2));
assertTrue("Scale should be equals to a same scale",
!scale.equals(scale3));
assertTrue("Scale should be equals to a same scale",
!scale4.equals(scale));
assertTrue("Scale should be equals to a same scale",
!scale5.equals(scale));
assertTrue("Scale hashcode should be equals to a same scale hashCode",
scale.hashCode() == scale1.hashCode());
assertTrue(