public void Absolute_WithAbsolutePressureReference_IsEqual() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Absolute); AssertEx.EqualTolerance(3, refPressure.Absolute.Atmospheres, AtmospheresTolerance); }
public static Pressure?Atmospheres <T>(this T?value) where T : struct => Pressure.FromAtmospheres(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void NumberToAtmospheresTest() => Assert.Equal(Pressure.FromAtmospheres(2), 2.Atmospheres());
public void Vacuum_WithVacuumPressureReference_IsEqual() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(1), PressureReference.Vacuum); AssertEx.EqualTolerance(1, refPressure.Vacuum.Atmospheres, AtmospheresTolerance); }
/// <inheritdoc cref="Pressure.FromAtmospheres(UnitsNet.QuantityValue)" /> public static Pressure Atmospheres <T>(this T value) => Pressure.FromAtmospheres(Convert.ToDouble(value));
public void Vacuum_WithDefaultPressureReference_IsOneLessAtmosphereNegative() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3)); AssertEx.EqualTolerance(-2, refPressure.Vacuum.Atmospheres, AtmospheresTolerance); }
public void Vacuum_WithGaugePressureReference_IsNegative() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Gauge); AssertEx.EqualTolerance(-3, refPressure.Vacuum.Atmospheres, AtmospheresTolerance); }
public void Gauge_WithVacuumPressureReference_ThrowsArgumentOutOfRangeException() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Vacuum); Assert.Throws <ArgumentOutOfRangeException>(() => refPressure.Gauge.Atmospheres); }
public void Reference_WithDefaultPressureReference_IsAbsolute() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3)); Equals(PressureReference.Absolute, refPressure.Reference); }
public void Gauge_WithVacuumPressureReference_IsNegative() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(1), PressureReference.Vacuum); AssertEx.EqualTolerance(-1, refPressure.Gauge.Atmospheres, AtmospheresTolerance); }
public void Gauge_WithDefaultPressureReference_IsOneLessAtmosphere() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3)); AssertEx.EqualTolerance(2, refPressure.Gauge.Atmospheres, AtmospheresTolerance); }
public void Absolute_WithVacuumPressureReference_IsOneLessAtmosphereNegative() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(1), PressureReference.Vacuum); AssertEx.EqualTolerance(0, refPressure.Absolute.Atmospheres, AtmospheresTolerance); }
public void Absolute_WithNegativeGaugePressureReference_ThrowsArgumentOutOfRangeException() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(-3), PressureReference.Gauge); Assert.Throws <ArgumentOutOfRangeException>(() => refPressure.Absolute.Atmospheres); }
public void Absolute_WithGaugePressureReference_IsOneMore() { var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Gauge); AssertEx.EqualTolerance(4, refPressure.Absolute.Atmospheres, AtmospheresTolerance); }