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 NumberToMegapascalsPerSecondTest() => Assert.Equal(PressureChangeRate.FromMegapascalsPerSecond(2), 2.MegapascalsPerSecond());
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double?)"/> public static PressureChangeRate?MegapascalsPerSecond(this decimal?value) => PressureChangeRate.FromMegapascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double)"/> public static PressureChangeRate MegapascalsPerSecond(this decimal value) => PressureChangeRate.FromMegapascalsPerSecond(Convert.ToDouble(value));
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double?)"/> public static PressureChangeRate?MegapascalsPerSecond(this float?value) => PressureChangeRate.FromMegapascalsPerSecond(value);
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double)"/> public static PressureChangeRate MegapascalsPerSecond(this double value) => PressureChangeRate.FromMegapascalsPerSecond(value);
public static PressureChangeRate MegapascalsPerSecond <T>(this T value) => PressureChangeRate.FromMegapascalsPerSecond(Convert.ToDecimal(value));
public static PressureChangeRate?MegapascalsPerSecond <T>(this T?value) where T : struct => PressureChangeRate.FromMegapascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));