@Test public void return_positiveNumber_if_parse_with_string_input_between_0_and_99() throws InvalidPositiveOrZeroNumberException { PositiveOrZeroNumber positiveOrZeroNumber = PositiveOrZeroNumber.parse("99"); assertThat(positiveOrZeroNumber, notNullValue()); }
public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } PositiveOrZeroNumber(int value); }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } PositiveOrZeroNumber(int value); static PositiveOrZeroNumber parse(String positiveNumber); int getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PositiveOrZeroNumber { public static PositiveOrZeroNumber parse(String positiveNumber) throws InvalidPositiveOrZeroNumberException { int numericValue; try { numericValue = Integer.parseInt(positiveNumber); } catch (NumberFormatException e) { throw new InvalidPositiveOrZeroNumberException(); } return new PositiveOrZeroNumber(numericValue); } PositiveOrZeroNumber(int value); static PositiveOrZeroNumber parse(String positiveNumber); int getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }