/** * A unit test suite for JUnit. * * @return The test suite */ @Test public void testDefault() throws ClassNotFoundException, CDKException, Exception { IRule rule = new ChargeRule(); Object[] objects = rule.getParameters(); Assert.assertEquals(1, objects.length); double charge = (Double) objects[0]; Assert.assertEquals(0.0, charge, 0.00001); }
/** * A unit test suite for JUnit. * * @return The test suite */ @Test public void testSetParameters() throws ClassNotFoundException, CDKException, Exception { IRule rule = new ChargeRule(); Object[] params = new Object[1]; params[0] = -1.0; rule.setParameters(params); Object[] objects = rule.getParameters(); Assert.assertEquals(1, objects.length); double charge = (Double) objects[0]; Assert.assertEquals(-1.0, charge, 0.00001); }