@Test public void parseInt_valueIsValid_correspondingNumberReturned() { final String value = "0"; int result = InputParser.parseInt(value, INPUT_NAME); assertEquals(Integer.parseInt(value), result); }
public static int parseInt(String value, String inputName) { try { return Integer.parseInt(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } }
InputParser { public static int parseInt(String value, String inputName) { try { return Integer.parseInt(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } }
InputParser { public static int parseInt(String value, String inputName) { try { return Integer.parseInt(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); }
InputParser { public static int parseInt(String value, String inputName) { try { return Integer.parseInt(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); static String parseDescription(String descr); static short parseShort(String value, String inputName); static int parseInt(String value, String inputName); static boolean parseBoolean(String value, String inputName); static Region parseRegion(String value); static T parseEnum(String value, Class<T> clazz, String inputName); }
InputParser { public static int parseInt(String value, String inputName) { try { return Integer.parseInt(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); static String parseDescription(String descr); static short parseShort(String value, String inputName); static int parseInt(String value, String inputName); static boolean parseBoolean(String value, String inputName); static Region parseRegion(String value); static T parseEnum(String value, Class<T> clazz, String inputName);  }