public void ConversionRoundTrip() { BrakeSpecificFuelConsumption kilogramperjoule = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); AssertEx.EqualTolerance(1, BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(kilogramperjoule.GramsPerKiloWattHour).KilogramsPerJoule, GramsPerKiloWattHourTolerance); AssertEx.EqualTolerance(1, BrakeSpecificFuelConsumption.FromKilogramsPerJoule(kilogramperjoule.KilogramsPerJoule).KilogramsPerJoule, KilogramsPerJouleTolerance); AssertEx.EqualTolerance(1, BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(kilogramperjoule.PoundsPerMechanicalHorsepowerHour).KilogramsPerJoule, PoundsPerMechanicalHorsepowerHourTolerance); }
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(double?)"/> public static BrakeSpecificFuelConsumption?PoundsPerMechanicalHorsepowerHour(this decimal?value) => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(double)"/> public static BrakeSpecificFuelConsumption PoundsPerMechanicalHorsepowerHour(this decimal value) => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(Convert.ToDouble(value));
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(double?)"/> public static BrakeSpecificFuelConsumption?PoundsPerMechanicalHorsepowerHour(this float?value) => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(value);
public void NumberToPoundsPerMechanicalHorsepowerHourTest() => Assert.Equal(BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(2), 2.PoundsPerMechanicalHorsepowerHour());
public static BrakeSpecificFuelConsumption?PoundsPerMechanicalHorsepowerHour <T>(this T?value) where T : struct => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(value == null ? (double?)null : Convert.ToDouble(value.Value));