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 NumberToMilliluxTest() =>
 Assert.Equal(Illuminance.FromMillilux(2), 2.Millilux());
Пример #4
0
 public static Illuminance?Millilux <T>(this T?value) where T : struct => Illuminance.FromMillilux(value == null ? (double?)null : Convert.ToDouble(value.Value));
Пример #5
0
 /// <inheritdoc cref="Illuminance.FromMillilux(UnitsNet.QuantityValue)" />
 public static Illuminance Millilux <T>(this T value) => Illuminance.FromMillilux(Convert.ToDouble(value));
 /// <inheritdoc cref="Illuminance.FromMillilux(double?)"/>
 public static Illuminance?Millilux(this decimal?value) => Illuminance.FromMillilux(value == null ? (double?)null : Convert.ToDouble(value.Value));
 /// <inheritdoc cref="Illuminance.FromMillilux(double)"/>
 public static Illuminance Millilux(this decimal value) => Illuminance.FromMillilux(Convert.ToDouble(value));
 /// <inheritdoc cref="Illuminance.FromMillilux(double?)"/>
 public static Illuminance?Millilux(this float?value) => Illuminance.FromMillilux(value);
 /// <inheritdoc cref="Illuminance.FromMillilux(double?)"/>
 public static Illuminance?Millilux(this double?value) => Illuminance.FromMillilux(value);
 /// <inheritdoc cref="Illuminance.FromMillilux(double)"/>
 public static Illuminance Millilux(this long value) => Illuminance.FromMillilux(value);