public void ConversionRoundTrip() { PressureChangeRate pascalpersecond = PressureChangeRate.FromPascalsPerSecond(1); AssertEx.EqualTolerance(1, PressureChangeRate.FromAtmospheresPerSecond(pascalpersecond.AtmospheresPerSecond).PascalsPerSecond, AtmospheresPerSecondTolerance); AssertEx.EqualTolerance(1, PressureChangeRate.FromKilopascalsPerSecond(pascalpersecond.KilopascalsPerSecond).PascalsPerSecond, KilopascalsPerSecondTolerance); AssertEx.EqualTolerance(1, PressureChangeRate.FromMegapascalsPerSecond(pascalpersecond.MegapascalsPerSecond).PascalsPerSecond, MegapascalsPerSecondTolerance); AssertEx.EqualTolerance(1, PressureChangeRate.FromPascalsPerSecond(pascalpersecond.PascalsPerSecond).PascalsPerSecond, PascalsPerSecondTolerance); }
public void NumberToAtmospheresPerSecondTest() => Assert.Equal(PressureChangeRate.FromAtmospheresPerSecond(2), 2.AtmospheresPerSecond());
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(double?)"/> public static PressureChangeRate?AtmospheresPerSecond(this decimal?value) => PressureChangeRate.FromAtmospheresPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(double)"/> public static PressureChangeRate AtmospheresPerSecond(this decimal value) => PressureChangeRate.FromAtmospheresPerSecond(Convert.ToDouble(value));
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(double?)"/> public static PressureChangeRate?AtmospheresPerSecond(this float?value) => PressureChangeRate.FromAtmospheresPerSecond(value);
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(double)"/> public static PressureChangeRate AtmospheresPerSecond(this double value) => PressureChangeRate.FromAtmospheresPerSecond(value);
public static PressureChangeRate AtmospheresPerSecond <T>(this T value) => PressureChangeRate.FromAtmospheresPerSecond(Convert.ToDecimal(value));
public static PressureChangeRate?AtmospheresPerSecond <T>(this T?value) where T : struct => PressureChangeRate.FromAtmospheresPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));