public void ConversionRoundTrip() { TemperatureDelta kelvindelta = TemperatureDelta.FromKelvinsDelta(1); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsiusDelta(kelvindelta.DegreesCelsiusDelta).KelvinsDelta, DegreesCelsiusDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesDelisleDelta(kelvindelta.DegreesDelisleDelta).KelvinsDelta, DegreesDelisleDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheitDelta(kelvindelta.DegreesFahrenheitDelta).KelvinsDelta, DegreesFahrenheitDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewtonDelta(kelvindelta.DegreesNewtonDelta).KelvinsDelta, DegreesNewtonDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankineDelta(kelvindelta.DegreesRankineDelta).KelvinsDelta, DegreesRankineDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesReaumurDelta(kelvindelta.DegreesReaumurDelta).KelvinsDelta, DegreesReaumurDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRoemerDelta(kelvindelta.DegreesRoemerDelta).KelvinsDelta, DegreesRoemerDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvinsDelta(kelvindelta.KelvinsDelta).KelvinsDelta, KelvinsDeltaTolerance); }
public void ConversionRoundTrip() { TemperatureDelta kelvin = TemperatureDelta.FromKelvins(1); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsius(kelvin.DegreesCelsius).Kelvins, DegreesCelsiusTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsiusDelta(kelvin.DegreesCelsiusDelta).Kelvins, DegreesCelsiusDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheit(kelvin.DegreesFahrenheit).Kelvins, DegreesFahrenheitTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheitDelta(kelvin.DegreesFahrenheitDelta).Kelvins, DegreesFahrenheitDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewton(kelvin.DegreesNewton).Kelvins, DegreesNewtonTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewtonDelta(kelvin.DegreesNewtonDelta).Kelvins, DegreesNewtonDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankine(kelvin.DegreesRankine).Kelvins, DegreesRankineTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankineDelta(kelvin.DegreesRankineDelta).Kelvins, DegreesRankineDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvins(kelvin.Kelvins).Kelvins, KelvinsTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvinsDelta(kelvin.KelvinsDelta).Kelvins, KelvinsDeltaTolerance); }
/// <inheritdoc cref="TemperatureDelta.FromDegreesCelsiusDelta(double?)"/> public static TemperatureDelta?DegreesCelsiusDelta(this decimal?value) => TemperatureDelta.FromDegreesCelsiusDelta(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="TemperatureDelta.FromDegreesCelsiusDelta(double)"/> public static TemperatureDelta DegreesCelsiusDelta(this decimal value) => TemperatureDelta.FromDegreesCelsiusDelta(Convert.ToDouble(value));
/// <inheritdoc cref="TemperatureDelta.FromDegreesCelsiusDelta(double?)"/> public static TemperatureDelta?DegreesCelsiusDelta(this float?value) => TemperatureDelta.FromDegreesCelsiusDelta(value);
/// <inheritdoc cref="TemperatureDelta.FromDegreesCelsiusDelta(double)"/> public static TemperatureDelta DegreesCelsiusDelta(this double value) => TemperatureDelta.FromDegreesCelsiusDelta(value);
public void LapseRateMultipliedByLengthEqualsTemperatureDelta() { TemperatureDelta temperatureDelta = LapseRate.FromDegreesCelciusPerKilometer(5) * Length.FromKilometers(10); Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsiusDelta(50)); }
public void TemperatureDeltaDividedByLengthEqualsLapseRate() { LapseRate lapseRate = TemperatureDelta.FromDegreesCelsiusDelta(50) / Length.FromKilometers(10); Assert.Equal(lapseRate, LapseRate.FromDegreesCelciusPerKilometer(5)); }
public void TemperatureDeltaDividedByLapseRateEqualsLength() { Length length = TemperatureDelta.FromDegreesCelsiusDelta(50) / LapseRate.FromDegreesCelciusPerKilometer(5); Assert.Equal(length, Length.FromKilometers(10)); }
public static TemperatureDelta operator *(LapseRate left, Length right) { return(TemperatureDelta.FromDegreesCelsiusDelta(left.DegreesCelciusPerKilometer * right.Kilometers)); }
public static TemperatureDelta?DegreesCelsiusDelta <T>(this T?value) where T : struct => TemperatureDelta.FromDegreesCelsiusDelta(value == null ? (double?)null : Convert.ToDouble(value.Value));