public void ConversionRoundTrip()
        {
            TemperatureDelta kelvin = TemperatureDelta.FromKelvins(1);

            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsius(kelvin.DegreesCelsius).Kelvins, DegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesDelisle(kelvin.DegreesDelisle).Kelvins, DegreesDelisleTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheit(kelvin.DegreesFahrenheit).Kelvins, DegreesFahrenheitTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewton(kelvin.DegreesNewton).Kelvins, DegreesNewtonTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankine(kelvin.DegreesRankine).Kelvins, DegreesRankineTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesReaumur(kelvin.DegreesReaumur).Kelvins, DegreesReaumurTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRoemer(kelvin.DegreesRoemer).Kelvins, DegreesRoemerTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvins(kelvin.Kelvins).Kelvins, KelvinsTolerance);
        }
        public void ConversionRoundTrip()
        {
            TemperatureDelta kelvin = TemperatureDelta.FromKelvins(1);

            AssertEx.EqualTolerance(1, TemperatureDelta.FromCentidegreesCelsius(kelvin.CentidegreesCelsius).Kelvins, CentidegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDecidegreesCelsius(kelvin.DecidegreesCelsius).Kelvins, DecidegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsius(kelvin.DegreesCelsius).Kelvins, DegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesDelisle(kelvin.DegreesDelisle).Kelvins, DegreesDelisleTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheit(kelvin.DegreesFahrenheit).Kelvins, DegreesFahrenheitTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewton(kelvin.DegreesNewton).Kelvins, DegreesNewtonTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankine(kelvin.DegreesRankine).Kelvins, DegreesRankineTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesReaumur(kelvin.DegreesReaumur).Kelvins, DegreesReaumurTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRoemer(kelvin.DegreesRoemer).Kelvins, DegreesRoemerTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromHectodegreesCelsius(kelvin.HectodegreesCelsius).Kelvins, HectodegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvins(kelvin.Kelvins).Kelvins, KelvinsTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromKilodegreesCelsius(kelvin.KilodegreesCelsius).Kelvins, KilodegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromMicrodegreesCelsius(kelvin.MicrodegreesCelsius).Kelvins, MicrodegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromMillidegreesCelsius(kelvin.MillidegreesCelsius).Kelvins, MillidegreesCelsiusTolerance);
            AssertEx.EqualTolerance(1, TemperatureDelta.FromNanodegreesCelsius(kelvin.NanodegreesCelsius).Kelvins, NanodegreesCelsiusTolerance);
        }
Exemple #3
0
 /// <inheritdoc cref="TemperatureDelta.FromDegreesDelisle(double?)"/>
 public static TemperatureDelta?DegreesDelisle(this decimal?value) => TemperatureDelta.FromDegreesDelisle(value == null ? (double?)null : Convert.ToDouble(value.Value));
Exemple #4
0
 /// <inheritdoc cref="TemperatureDelta.FromDegreesDelisle(double)"/>
 public static TemperatureDelta DegreesDelisle(this decimal value) => TemperatureDelta.FromDegreesDelisle(Convert.ToDouble(value));
Exemple #5
0
 /// <inheritdoc cref="TemperatureDelta.FromDegreesDelisle(double?)"/>
 public static TemperatureDelta?DegreesDelisle(this float?value) => TemperatureDelta.FromDegreesDelisle(value);
Exemple #6
0
 /// <inheritdoc cref="TemperatureDelta.FromDegreesDelisle(double)"/>
 public static TemperatureDelta DegreesDelisle(this double value) => TemperatureDelta.FromDegreesDelisle(value);
 public void NumberToDegreesDelisleTest() =>
 Assert.Equal(TemperatureDelta.FromDegreesDelisle(2), 2.DegreesDelisle());
Exemple #8
0
 public static TemperatureDelta DegreesDelisle <T>(this T value) =>
 TemperatureDelta.FromDegreesDelisle(Convert.ToDecimal(value));
 public static TemperatureDelta?DegreesDelisle <T>(this T?value) where T : struct => TemperatureDelta.FromDegreesDelisle(value == null ? (double?)null : Convert.ToDouble(value.Value));