NumericFunctions { static public String executeFunction(String[] values, Variables variables) { try { if (values[2].equalsIgnoreCase("mod")) { return NumericFunctions.mod(NumberUtils.toInt(values[3]), NumberUtils.toInt(values[4])); } else if (values[2].equalsIgnoreCase("randompositivewhole")) { return NumericFunctions.randomPositiveWhole(NumberUtils.toInt(values[3])); } else if (values[2].equalsIgnoreCase("randomnegativewhole")) { return NumericFunctions.randomNegativeWhole(NumberUtils.toInt(values[3])); } else if (values[2].equalsIgnoreCase("randompositivefloat")) { return NumericFunctions.randomPositiveFloat(NumberUtils.toInt(values[3]), NumberUtils.toInt(values[4])); } else if (values[2].equalsIgnoreCase("randomnegativefloat")) { return NumericFunctions.randomNegativeFloat(NumberUtils.toInt(values[3]), NumberUtils.toInt(values[4])); } else if (values[2].equalsIgnoreCase("add")) { return NumericFunctions.add(values, variables); } else if (values[2].equalsIgnoreCase("subtract")) { return NumericFunctions.subtract(values, variables); } return ""; } catch (Exception ex) { return ""; } }  static boolean isValid(String[] values); static String executeFunction(String[] values, Variables variables); static String randomPositiveWhole(int length); static String randomNegativeWhole(int length); static String randomPositiveFloat(int whole, int decimal); static String randomNegativeFloat(int whole, int decimal);  }
@Test public void testExecuteFunction_1() throws Exception { String[] values = new String[] { null, null, null, "", "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_2() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_3() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_4() throws Exception { String[] values = new String[] { null, null, "", "", "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_5() throws Exception { String[] values = new String[] { null, null, "", "", "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_6() throws Exception { String[] values = new String[] { null, null, "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_7() throws Exception { String[] values = new String[] { null, null, "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_8() throws Exception { String[] values = new String[] { null, null, "" }; Variables variables = new Variables(); String result = NumericFunctions.executeFunction(values, variables); assertNotNull(result); }