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
        public void MassFlowDividedByBrakeSpecificFuelConsumptionEqualsPower()
        {
            Power power = MassFlow.FromTonnesPerDay(20) / BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(180.0);

            Assert.Equal(20.0 / 24.0 * 1e6 / 180.0, power.Kilowatts);
        }
Esempio n. 3
0
 /// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double)"/>
 public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this decimal value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(Convert.ToDouble(value));
Esempio n. 4
0
 /// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double?)"/>
 public static BrakeSpecificFuelConsumption?GramsPerKiloWattHour(this decimal?value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value == null ? (double?)null : Convert.ToDouble(value.Value));
Esempio n. 5
0
 /// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double)"/>
 public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this double value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value);
Esempio n. 6
0
 /// <inheritdoc cref="BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(double?)"/>
 public static BrakeSpecificFuelConsumption?GramsPerKiloWattHour(this float?value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value);
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        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());
Esempio n. 10
0
 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));