@Test public void GIVEN_null_solar_percentage_WHEN_formatting_requested_THEN_returns_blank_percentage_value() { testee = new SolarPercentageFormatter(null); assertEquals("--%", testee.format()); }
public String format() { String formatted = "--%"; if (solarPercentage != null) { formatted = String.format(Locale.US, "%1d%%", solarPercentage); } return formatted; }
SolarPercentageFormatter { public String format() { String formatted = "--%"; if (solarPercentage != null) { formatted = String.format(Locale.US, "%1d%%", solarPercentage); } return formatted; } }
SolarPercentageFormatter { public String format() { String formatted = "--%"; if (solarPercentage != null) { formatted = String.format(Locale.US, "%1d%%", solarPercentage); } return formatted; } SolarPercentageFormatter(Integer solarPercentage); }
SolarPercentageFormatter { public String format() { String formatted = "--%"; if (solarPercentage != null) { formatted = String.format(Locale.US, "%1d%%", solarPercentage); } return formatted; } SolarPercentageFormatter(Integer solarPercentage); String format(); }
SolarPercentageFormatter { public String format() { String formatted = "--%"; if (solarPercentage != null) { formatted = String.format(Locale.US, "%1d%%", solarPercentage); } return formatted; } SolarPercentageFormatter(Integer solarPercentage); String format();  }