GenericFunctions { public static String executeFunction(String[] values, Variables variables) { try { if (values[2].equalsIgnoreCase("getcsv")) { return GenericFunctions.getCSVData(Integer.parseInt(values[3])); } else if (values[2].equalsIgnoreCase("getfiledata")) { return GenericFunctions.getCSVData(values, variables); } else if (values[2].equalsIgnoreCase("getssn")) { return GenericFunctions.getSsn(values[3]); } return ""; } catch (Exception ex) { return ""; } }  static boolean isValid(String[] values); static String executeFunction(String[] values, Variables variables); static String getCSVData(int index); static String getCSVData(String[] values, Variables variables); static String getSsn(String val);  }
@Test public void testExecuteFunction_1() throws Exception { String[] values = new String[] { null, null, null, "0" }; Variables variables = new Variables(); String result = GenericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_2() throws Exception { String[] values = new String[] { null, null, "" }; Variables variables = new Variables(); String result = GenericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_3() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String result = GenericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_4() throws Exception { String[] values = new String[] { null, null, "" }; Variables variables = new Variables(); String result = GenericFunctions.executeFunction(values, variables); assertNotNull(result); }
@Test public void testExecuteFunction_5() throws Exception { String[] values = new String[] { null, null, null, "" }; Variables variables = new Variables(); String result = GenericFunctions.executeFunction(values, variables); assertNotNull(result); }