Class PressureConverterTest

java.lang.Object
com.irurueta.units.PressureConverterTest

class PressureConverterTest extends Object
  • Field Details

    • PASCALS_PER_KILOPASCAL

      private static final double PASCALS_PER_KILOPASCAL
      Pascals in a kilopascal.
      See Also:
    • PASCALS_PER_BAR

      private static final double PASCALS_PER_BAR
      Pascals in a bar.
      See Also:
    • PASCALS_PER_ATMOSPHERE

      private static final double PASCALS_PER_ATMOSPHERE
      Pascals in a standard atmosphere.
      See Also:
    • PASCALS_PER_PSI

      private static final double PASCALS_PER_PSI
      Pascals in a pound per square inch.
      See Also:
    • VALUE

      private static final double VALUE
      Arbitrary input value.
      See Also:
    • ERROR

      private static final double ERROR
      Allowed error in comparisons.
      See Also:
  • Constructor Details

    • PressureConverterTest

      PressureConverterTest()
  • Method Details

    • kilopascalsToPascals_whenValue_returnsExpectedResult

      @Test void kilopascalsToPascals_whenValue_returnsExpectedResult()
      Checks pascal to/from kilopascal conversions.
    • barsToPascals_whenValue_returnsExpectedResult

      @Test void barsToPascals_whenValue_returnsExpectedResult()
      Checks pascal to/from bar conversions.
    • atmospheresToPascals_whenValue_returnsExpectedResult

      @Test void atmospheresToPascals_whenValue_returnsExpectedResult()
      Checks pascal to/from atmosphere conversions.
    • psiToPascals_whenValue_returnsExpectedResult

      @Test void psiToPascals_whenValue_returnsExpectedResult()
      Checks pascal to/from psi conversions.
    • convert_whenKnownValues_returnsExpectedResult

      @Test void convert_whenKnownValues_returnsExpectedResult()
      Checks known reference values.
    • convert_whenDoubleAndAnyUnitPair_returnsExpectedResult

      @Test void convert_whenDoubleAndAnyUnitPair_returnsExpectedResult()
      Checks conversions between every pair of units, going through pascals.
    • convert_whenRoundTrip_returnsOriginalValue

      @Test void convert_whenRoundTrip_returnsOriginalValue()
      Checks that converting back and forth recovers the original value.
    • convert_whenNullUnit_throwsNullPointerException

      @Test void convert_whenNullUnit_throwsNullPointerException()
      Checks that conversion with a null unit fails.
    • convert_whenNumber_returnsExpectedResult

      @Test void convert_whenNumber_returnsExpectedResult()
      Checks conversion of a Number.
    • convert_whenNullNumber_throwsNullPointerException

      @Test void convert_whenNullNumber_throwsNullPointerException()
      Checks that a null Number fails.
    • convert_whenInputAndResultInstances_storesResultAndKeepsInput

      @Test void convert_whenInputAndResultInstances_storesResultAndKeepsInput()
      Checks conversion storing the result in a provided instance.
    • convert_whenPressureAndUnit_updatesInstance

      @Test void convert_whenPressureAndUnit_updatesInstance()
      Checks in-place conversion.
    • convertAndReturnNew_whenPressure_returnsNewConvertedInstance

      @Test void convertAndReturnNew_whenPressure_returnsNewConvertedInstance()
      Checks conversion returning a new instance.
    • convert_whenOutputInstance_usesOutputUnit

      @Test void convert_whenOutputInstance_usesOutputUnit()
      Checks conversion using the unit of the output instance.