public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, Capacitance.From(1, CapacitanceUnit.Farad).Farads, FaradsTolerance);
     AssertEx.EqualTolerance(1, Capacitance.From(1, CapacitanceUnit.Microfarad).Microfarads, MicrofaradsTolerance);
     AssertEx.EqualTolerance(1, Capacitance.From(1, CapacitanceUnit.Millifarad).Millifarads, MillifaradsTolerance);
     AssertEx.EqualTolerance(1, Capacitance.From(1, CapacitanceUnit.Nanofarad).Nanofarads, NanofaradsTolerance);
     AssertEx.EqualTolerance(1, Capacitance.From(1, CapacitanceUnit.Picofarad).Picofarads, PicofaradsTolerance);
 }
Пример #2
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = Capacitance.From(1, CapacitanceUnit.Farad);

            AssertEx.EqualTolerance(1, quantity00.Farads, FaradsTolerance);
            Assert.Equal(CapacitanceUnit.Farad, quantity00.Unit);

            var quantity01 = Capacitance.From(1, CapacitanceUnit.Kilofarad);

            AssertEx.EqualTolerance(1, quantity01.Kilofarads, KilofaradsTolerance);
            Assert.Equal(CapacitanceUnit.Kilofarad, quantity01.Unit);

            var quantity02 = Capacitance.From(1, CapacitanceUnit.Megafarad);

            AssertEx.EqualTolerance(1, quantity02.Megafarads, MegafaradsTolerance);
            Assert.Equal(CapacitanceUnit.Megafarad, quantity02.Unit);

            var quantity03 = Capacitance.From(1, CapacitanceUnit.Microfarad);

            AssertEx.EqualTolerance(1, quantity03.Microfarads, MicrofaradsTolerance);
            Assert.Equal(CapacitanceUnit.Microfarad, quantity03.Unit);

            var quantity04 = Capacitance.From(1, CapacitanceUnit.Millifarad);

            AssertEx.EqualTolerance(1, quantity04.Millifarads, MillifaradsTolerance);
            Assert.Equal(CapacitanceUnit.Millifarad, quantity04.Unit);

            var quantity05 = Capacitance.From(1, CapacitanceUnit.Nanofarad);

            AssertEx.EqualTolerance(1, quantity05.Nanofarads, NanofaradsTolerance);
            Assert.Equal(CapacitanceUnit.Nanofarad, quantity05.Unit);

            var quantity06 = Capacitance.From(1, CapacitanceUnit.Picofarad);

            AssertEx.EqualTolerance(1, quantity06.Picofarads, PicofaradsTolerance);
            Assert.Equal(CapacitanceUnit.Picofarad, quantity06.Unit);
        }
Пример #3
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, Capacitance.From(1, CapacitanceUnit.Farad).Farads, FaradsTolerance);
 }