public void ConversionRoundTrip()
        {
            Illuminance lux = Illuminance.FromLux(1);

            AssertEx.EqualTolerance(1, Illuminance.FromCentilux(lux.Centilux).Lux, CentiluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromDecalux(lux.Decalux).Lux, DecaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromDecilux(lux.Decilux).Lux, DeciluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromExalux(lux.Exalux).Lux, ExaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromFemtolux(lux.Femtolux).Lux, FemtoluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromGigalux(lux.Gigalux).Lux, GigaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromHectolux(lux.Hectolux).Lux, HectoluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromKilolux(lux.Kilolux).Lux, KiloluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromLux(lux.Lux).Lux, LuxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromMegalux(lux.Megalux).Lux, MegaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromMicrolux(lux.Microlux).Lux, MicroluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromMillilux(lux.Millilux).Lux, MilliluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromNanolux(lux.Nanolux).Lux, NanoluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromPetalux(lux.Petalux).Lux, PetaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromPicolux(lux.Picolux).Lux, PicoluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromQutralux(lux.Qutralux).Lux, QutraluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromTeralux(lux.Teralux).Lux, TeraluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromVettalux(lux.Vettalux).Lux, VettaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromYottalux(lux.Yottalux).Lux, YottaluxTolerance);
            AssertEx.EqualTolerance(1, Illuminance.FromZettalux(lux.Zettalux).Lux, ZettaluxTolerance);
        }
Пример #2
0
 public void ConversionRoundTrip()
 {
     Illuminance lux = Illuminance.FromLux(1);
     AssertEx.EqualTolerance(1, Illuminance.FromKilolux(lux.Kilolux).Lux, KiloluxTolerance);
     AssertEx.EqualTolerance(1, Illuminance.FromLux(lux.Lux).Lux, LuxTolerance);
     AssertEx.EqualTolerance(1, Illuminance.FromMegalux(lux.Megalux).Lux, MegaluxTolerance);
     AssertEx.EqualTolerance(1, Illuminance.FromMillilux(lux.Millilux).Lux, MilliluxTolerance);
 }
Пример #3
0
 public void NumberToMegaluxTest() =>
 Assert.Equal(Illuminance.FromMegalux(2), 2.Megalux());
Пример #4
0
 public static Illuminance?Megalux <T>(this T?value) where T : struct => Illuminance.FromMegalux(value == null ? (double?)null : Convert.ToDouble(value.Value));
Пример #5
0
 /// <inheritdoc cref="Illuminance.FromMegalux(UnitsNet.QuantityValue)" />
 public static Illuminance Megalux <T>(this T value) => Illuminance.FromMegalux(Convert.ToDouble(value));
 /// <inheritdoc cref="Illuminance.FromMegalux(double?)"/>
 public static Illuminance?Megalux(this decimal?value) => Illuminance.FromMegalux(value == null ? (double?)null : Convert.ToDouble(value.Value));
 /// <inheritdoc cref="Illuminance.FromMegalux(double)"/>
 public static Illuminance Megalux(this decimal value) => Illuminance.FromMegalux(Convert.ToDouble(value));
 /// <inheritdoc cref="Illuminance.FromMegalux(double?)"/>
 public static Illuminance?Megalux(this float?value) => Illuminance.FromMegalux(value);
 /// <inheritdoc cref="Illuminance.FromMegalux(double?)"/>
 public static Illuminance?Megalux(this double?value) => Illuminance.FromMegalux(value);
 /// <inheritdoc cref="Illuminance.FromMegalux(double)"/>
 public static Illuminance Megalux(this long value) => Illuminance.FromMegalux(value);