Пример #1
0
        public void ConversionRoundTrip()
        {
            Capacitance farad = Capacitance.FromFarads(1);

            AssertEx.EqualTolerance(1, Capacitance.FromFarads(farad.Farads).Farads, FaradsTolerance);
            AssertEx.EqualTolerance(1, Capacitance.FromKilofarads(farad.Kilofarads).Farads, KilofaradsTolerance);
            AssertEx.EqualTolerance(1, Capacitance.FromMegafarads(farad.Megafarads).Farads, MegafaradsTolerance);
            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 Kilofarads <T>(this T value) =>
 Capacitance.FromKilofarads(Convert.ToDecimal(value));
Пример #3
0
 public void NumberToKilofaradsTest() =>
 Assert.Equal(Capacitance.FromKilofarads(2), 2.Kilofarads());