Exemple #1
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = ApparentPower.From(1, ApparentPowerUnit.Gigavoltampere);

            AssertEx.EqualTolerance(1, quantity00.Gigavoltamperes, GigavoltamperesTolerance);
            Assert.Equal(ApparentPowerUnit.Gigavoltampere, quantity00.Unit);

            var quantity01 = ApparentPower.From(1, ApparentPowerUnit.Kilovoltampere);

            AssertEx.EqualTolerance(1, quantity01.Kilovoltamperes, KilovoltamperesTolerance);
            Assert.Equal(ApparentPowerUnit.Kilovoltampere, quantity01.Unit);

            var quantity02 = ApparentPower.From(1, ApparentPowerUnit.Megavoltampere);

            AssertEx.EqualTolerance(1, quantity02.Megavoltamperes, MegavoltamperesTolerance);
            Assert.Equal(ApparentPowerUnit.Megavoltampere, quantity02.Unit);

            var quantity03 = ApparentPower.From(1, ApparentPowerUnit.Voltampere);

            AssertEx.EqualTolerance(1, quantity03.Voltamperes, VoltamperesTolerance);
            Assert.Equal(ApparentPowerUnit.Voltampere, quantity03.Unit);
        }
Exemple #2
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, ApparentPower.From(1, ApparentPowerUnit.Kilovoltampere).Kilovoltamperes, KilovoltamperesTolerance);
     AssertEx.EqualTolerance(1, ApparentPower.From(1, ApparentPowerUnit.Megavoltampere).Megavoltamperes, MegavoltamperesTolerance);
     AssertEx.EqualTolerance(1, ApparentPower.From(1, ApparentPowerUnit.Voltampere).Voltamperes, VoltamperesTolerance);
 }