}
@Test
public void testConstructors() {
ISquare sq = ShapeFactory.createSquare();
assertEquals(4, sq.getNbPoints());
try {
sq = ShapeFactory.createSquare(null, 10);
fail();
}catch(IllegalArgumentException ex) { /* */ }
try {
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(Double.NaN, 0), 10);
fail();
}catch(IllegalArgumentException ex) { /* */ }
try {
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(), 0);
fail();
}catch(IllegalArgumentException ex) { /* */ }
try {
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(), -10);
fail();
}catch(IllegalArgumentException ex) { /* */ }
try {
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(), Double.NaN);
fail();
}catch(IllegalArgumentException ex) { /* */ }
try {
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(), Double.POSITIVE_INFINITY);
fail();
}catch(IllegalArgumentException ex) { /* */ }
try {
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(), Double.NEGATIVE_INFINITY);
fail();
}catch(IllegalArgumentException ex) { /* */ }
sq = ShapeFactory.createSquare(ShapeFactory.createPoint(20, 26), 11);
HelperTest.assertEqualsDouble(20., sq.getPosition().getX());
HelperTest.assertEqualsDouble(26., sq.getPosition().getY());
HelperTest.assertEqualsDouble(11., sq.getWidth());
HelperTest.assertEqualsDouble(11., sq.getHeight());
}