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); }
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); }
public void NumberToKiloluxTest() => Assert.Equal(Illuminance.FromKilolux(2), 2.Kilolux());
public static Illuminance?Kilolux <T>(this T?value) where T : struct => Illuminance.FromKilolux(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="Illuminance.FromKilolux(UnitsNet.QuantityValue)" /> public static Illuminance Kilolux <T>(this T value) => Illuminance.FromKilolux(Convert.ToDouble(value));
/// <inheritdoc cref="Illuminance.FromKilolux(double?)"/> public static Illuminance?Kilolux(this decimal?value) => Illuminance.FromKilolux(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="Illuminance.FromKilolux(double)"/> public static Illuminance Kilolux(this decimal value) => Illuminance.FromKilolux(Convert.ToDouble(value));
/// <inheritdoc cref="Illuminance.FromKilolux(double?)"/> public static Illuminance?Kilolux(this float?value) => Illuminance.FromKilolux(value);
/// <inheritdoc cref="Illuminance.FromKilolux(double?)"/> public static Illuminance?Kilolux(this double?value) => Illuminance.FromKilolux(value);
/// <inheritdoc cref="Illuminance.FromKilolux(double)"/> public static Illuminance Kilolux(this long value) => Illuminance.FromKilolux(value);