Package com.irurueta.units
Class PressureConverterTest
java.lang.Object
com.irurueta.units.PressureConverterTest
Tests for
PressureConverter.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleAllowed error in comparisons.private static final doublePascals in a standard atmosphere.private static final doublePascals in a bar.private static final doublePascals in a kilopascal.private static final doublePascals in a pound per square inch.private static final doubleArbitrary input value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidChecks pascal to/from atmosphere conversions.(package private) voidChecks pascal to/from bar conversions.(package private) voidChecks conversions between every pair of units, going through pascals.(package private) voidChecks conversion storing the result in a provided instance.(package private) voidChecks known reference values.(package private) voidChecks that a null Number fails.(package private) voidChecks that conversion with a null unit fails.(package private) voidChecks conversion of a Number.(package private) voidChecks conversion using the unit of the output instance.(package private) voidChecks in-place conversion.(package private) voidChecks that converting back and forth recovers the original value.(package private) voidChecks conversion returning a new instance.(package private) voidChecks pascal to/from kilopascal conversions.(package private) voidChecks pascal to/from psi conversions.
-
Field Details
-
PASCALS_PER_KILOPASCAL
private static final double PASCALS_PER_KILOPASCALPascals in a kilopascal.- See Also:
-
PASCALS_PER_BAR
private static final double PASCALS_PER_BARPascals in a bar.- See Also:
-
PASCALS_PER_ATMOSPHERE
private static final double PASCALS_PER_ATMOSPHEREPascals in a standard atmosphere.- See Also:
-
PASCALS_PER_PSI
private static final double PASCALS_PER_PSIPascals in a pound per square inch.- See Also:
-
VALUE
private static final double VALUEArbitrary input value.- See Also:
-
ERROR
private static final double ERRORAllowed 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.
-