public void ConversionRoundTrip()
        {
            Capacitance farad = Capacitance.FromFarads(1);

            AssertEx.EqualTolerance(1, Capacitance.FromFarads(farad.Farads).Farads, FaradsTolerance);
            AssertEx.EqualTolerance(1, Capacitance.FromMicrofarads(farad.Microfarads).Farads, MicrofaradsTolerance);
            AssertEx.EqualTolerance(1, Capacitance.FromMillifarads(farad.Millifarads).Farads, MillifaradsTolerance);
            AssertEx.EqualTolerance(1, Capacitance.FromNanofarads(farad.Nanofarads).Farads, NanofaradsTolerance);
            AssertEx.EqualTolerance(1, Capacitance.FromPicofarads(farad.Picofarads).Farads, PicofaradsTolerance);
        }
 public static Capacitance Picofarads <T>(this T value) =>
 Capacitance.FromPicofarads(Convert.ToDecimal(value));
Пример #3
0
 public void NumberToPicofaradsTest() =>
 Assert.Equal(Capacitance.FromPicofarads(2), 2.Picofarads());
 public static Capacitance?Picofarads <T>(this T?value) where T : struct => Capacitance.FromPicofarads(value == null ? (double?)null : Convert.ToDouble(value.Value));