public void ConversionRoundTrip() { ElectricCurrent ampere = ElectricCurrent.FromAmperes(1); AssertEx.EqualTolerance(1, ElectricCurrent.FromAmperes(ampere.Amperes).Amperes, AmperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromKiloamperes(ampere.Kiloamperes).Amperes, KiloamperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromMegaamperes(ampere.Megaamperes).Amperes, MegaamperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromMicroamperes(ampere.Microamperes).Amperes, MicroamperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromMilliamperes(ampere.Milliamperes).Amperes, MilliamperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromNanoamperes(ampere.Nanoamperes).Amperes, NanoamperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromPicoamperes(ampere.Picoamperes).Amperes, PicoamperesTolerance); }
public void NumberToPicoamperesTest() => Assert.Equal(ElectricCurrent.FromPicoamperes(2), 2.Picoamperes());
/// <inheritdoc cref="ElectricCurrent.FromPicoamperes(UnitsNet.QuantityValue)" /> public static ElectricCurrent Picoamperes <T>(this T value) => ElectricCurrent.FromPicoamperes(Convert.ToDouble(value));
/// <inheritdoc cref="ElectricCurrent.FromPicoamperes(double?)"/> public static ElectricCurrent?Picoamperes(this decimal?value) => ElectricCurrent.FromPicoamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="ElectricCurrent.FromPicoamperes(double?)"/> public static ElectricCurrent?Picoamperes(this float?value) => ElectricCurrent.FromPicoamperes(value);
/// <inheritdoc cref="ElectricCurrent.FromPicoamperes(double)"/> public static ElectricCurrent Picoamperes(this double value) => ElectricCurrent.FromPicoamperes(value);
public static ElectricCurrent?Picoamperes <T>(this T?value) where T : struct => ElectricCurrent.FromPicoamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));