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); }
public void MassFlowDividedByBrakeSpecificFuelConsumptionEqualsPower() { Power power = MassFlow.FromTonnesPerDay(20) / BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(180.0); Assert.Equal(20.0 / 24.0 * 1e6 / 180.0, power.Kilowatts); }
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double)"/> public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this decimal value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(Convert.ToDouble(value));
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double?)"/> public static BrakeSpecificFuelConsumption?GramsPerKiloWattHour(this decimal?value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double)"/> public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this double value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value);
/// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double?)"/> public static BrakeSpecificFuelConsumption?GramsPerKiloWattHour(this float?value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value);
public void PowerTimesBrakeSpecificFuelConsumptionEqualsMassFlow() { MassFlow massFlow = Power.FromKilowatts(20.0 / 24.0 * 1e6 / 180.0) * BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(180.0); Assert.AreEqual(massFlow.TonnesPerDay, 20.0, 1e-11); }
public void PowerTimesBrakeSpecificFuelConsumptionEqualsMassFlow() { MassFlow massFlow = BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(180.0) * Power.FromKilowatts(20.0 / 24.0 * 1e6 / 180.0); AssertEx.EqualTolerance(20.0, massFlow.TonnesPerDay, 1e-11); }
public void NumberToGramsPerKiloWattHourTest() => Assert.Equal(BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(2), 2.GramsPerKiloWattHour());
public static BrakeSpecificFuelConsumption?GramsPerKiloWattHour <T>(this T?value) where T : struct => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value == null ? (double?)null : Convert.ToDouble(value.Value));
public static BrakeSpecificFuelConsumption GramsPerKiloWattHour <T>(this T value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(Convert.ToDecimal(value));