public void ConversionRoundTrip() { ElectricCurrent ampere = ElectricCurrent.FromAmperes(1); AssertEx.EqualTolerance(1, ElectricCurrent.FromAmperes(ampere.Amperes).Amperes, AmperesTolerance); AssertEx.EqualTolerance(1, ElectricCurrent.FromCentiamperes(ampere.Centiamperes).Amperes, CentiamperesTolerance); 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 NumberToCentiamperesTest() => Assert.Equal(ElectricCurrent.FromCentiamperes(2), 2.Centiamperes());
/// <inheritdoc cref="ElectricCurrent.FromCentiamperes(UnitsNet.QuantityValue)" /> public static ElectricCurrent Centiamperes <T>(this T value) => ElectricCurrent.FromCentiamperes(Convert.ToDouble(value));
/// <inheritdoc cref="ElectricCurrent.FromCentiamperes(UnitsNet.QuantityValue)" /> public static ElectricCurrent?Centiamperes(this double?value) => ElectricCurrent.FromCentiamperes(value);
/// <inheritdoc cref="ElectricCurrent.FromCentiamperes(UnitsNet.QuantityValue)" /> public static ElectricCurrent Centiamperes(this long value) => ElectricCurrent.FromCentiamperes(value);
/// <inheritdoc cref="ElectricCurrent.FromCentiamperes(UnitsNet.QuantityValue)" /> public static ElectricCurrent?Centiamperes(this decimal?value) => ElectricCurrent.FromCentiamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));
public static ElectricCurrent?Centiamperes <T>(this T?value) where T : struct => ElectricCurrent.FromCentiamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));