@Test public void GIVEN_populated_with_hectopascals_WHEN_hectopascals_requested_THEN_returns_correct_value() { testee = new Pressure(new BigDecimal("1017.7")); new BigDecimalEquals().assertEquals(new BigDecimal("1017.7"), testee.getValue(PressureUnit.HECTOPASCALS)); }
public BigDecimal getValue(PressureUnit unit) { BigDecimal value = null; switch (unit) { case HECTOPASCALS: value = hectopascals; break; case MILLIBARS: value = millibars; break; case KILIOPASCALS: value = kilopascals; break; case INCHES_OF_MERCURY: value = inchesOfMercury; break; case MILLIMETRES_OF_MERCURY: value = millimetresOfMercury; break; } return value; }
Pressure { public BigDecimal getValue(PressureUnit unit) { BigDecimal value = null; switch (unit) { case HECTOPASCALS: value = hectopascals; break; case MILLIBARS: value = millibars; break; case KILIOPASCALS: value = kilopascals; break; case INCHES_OF_MERCURY: value = inchesOfMercury; break; case MILLIMETRES_OF_MERCURY: value = millimetresOfMercury; break; } return value; } }
Pressure { public BigDecimal getValue(PressureUnit unit) { BigDecimal value = null; switch (unit) { case HECTOPASCALS: value = hectopascals; break; case MILLIBARS: value = millibars; break; case KILIOPASCALS: value = kilopascals; break; case INCHES_OF_MERCURY: value = inchesOfMercury; break; case MILLIMETRES_OF_MERCURY: value = millimetresOfMercury; break; } return value; } Pressure(BigDecimal hectopascals); }
Pressure { public BigDecimal getValue(PressureUnit unit) { BigDecimal value = null; switch (unit) { case HECTOPASCALS: value = hectopascals; break; case MILLIBARS: value = millibars; break; case KILIOPASCALS: value = kilopascals; break; case INCHES_OF_MERCURY: value = inchesOfMercury; break; case MILLIMETRES_OF_MERCURY: value = millimetresOfMercury; break; } return value; } Pressure(BigDecimal hectopascals); BigDecimal getValue(PressureUnit unit); }
Pressure { public BigDecimal getValue(PressureUnit unit) { BigDecimal value = null; switch (unit) { case HECTOPASCALS: value = hectopascals; break; case MILLIBARS: value = millibars; break; case KILIOPASCALS: value = kilopascals; break; case INCHES_OF_MERCURY: value = inchesOfMercury; break; case MILLIMETRES_OF_MERCURY: value = millimetresOfMercury; break; } return value; } Pressure(BigDecimal hectopascals); BigDecimal getValue(PressureUnit unit);  }