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);
        }
Esempio n. 2
0
 /// <inheritdoc cref="BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(double?)"/>
 public static BrakeSpecificFuelConsumption?PoundsPerMechanicalHorsepowerHour(this decimal?value) => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(value == null ? (double?)null : Convert.ToDouble(value.Value));
Esempio n. 3
0
 /// <inheritdoc cref="BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(double)"/>
 public static BrakeSpecificFuelConsumption PoundsPerMechanicalHorsepowerHour(this decimal value) => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(Convert.ToDouble(value));
Esempio n. 4
0
 /// <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());
Esempio n. 6
0
 public static BrakeSpecificFuelConsumption?PoundsPerMechanicalHorsepowerHour <T>(this T?value) where T : struct => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(value == null ? (double?)null : Convert.ToDouble(value.Value));