public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = MagneticField.From(1, MagneticFieldUnit.Gauss);

            AssertEx.EqualTolerance(1, quantity00.Gausses, GaussesTolerance);
            Assert.Equal(MagneticFieldUnit.Gauss, quantity00.Unit);

            var quantity01 = MagneticField.From(1, MagneticFieldUnit.Microtesla);

            AssertEx.EqualTolerance(1, quantity01.Microteslas, MicroteslasTolerance);
            Assert.Equal(MagneticFieldUnit.Microtesla, quantity01.Unit);

            var quantity02 = MagneticField.From(1, MagneticFieldUnit.Millitesla);

            AssertEx.EqualTolerance(1, quantity02.Milliteslas, MilliteslasTolerance);
            Assert.Equal(MagneticFieldUnit.Millitesla, quantity02.Unit);

            var quantity03 = MagneticField.From(1, MagneticFieldUnit.Nanotesla);

            AssertEx.EqualTolerance(1, quantity03.Nanoteslas, NanoteslasTolerance);
            Assert.Equal(MagneticFieldUnit.Nanotesla, quantity03.Unit);

            var quantity04 = MagneticField.From(1, MagneticFieldUnit.Tesla);

            AssertEx.EqualTolerance(1, quantity04.Teslas, TeslasTolerance);
            Assert.Equal(MagneticFieldUnit.Tesla, quantity04.Unit);
        }
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Microtesla).Microteslas, MicroteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Millitesla).Milliteslas, MilliteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Nanotesla).Nanoteslas, NanoteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Tesla).Teslas, TeslasTolerance);
 }
示例#3
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Decatesla).Decateslas, DecateslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Gigatesla).Gigateslas, GigateslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Kilotesla).Kiloteslas, KiloteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Megatesla).Megateslas, MegateslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Microtesla).Microteslas, MicroteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Millitesla).Milliteslas, MilliteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Nanotesla).Nanoteslas, NanoteslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Teratesla).Terateslas, TerateslasTolerance);
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Tesla).Teslas, TeslasTolerance);
 }
示例#4
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, MagneticField.From(1, MagneticFieldUnit.Tesla).Teslas, TeslasTolerance);
 }