Пример #1
0
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, PressureChangeRate.From(1, PressureChangeRateUnit.AtmospherePerSecond).AtmospheresPerSecond, AtmospheresPerSecondTolerance);
     AssertEx.EqualTolerance(1, PressureChangeRate.From(1, PressureChangeRateUnit.KilopascalPerSecond).KilopascalsPerSecond, KilopascalsPerSecondTolerance);
     AssertEx.EqualTolerance(1, PressureChangeRate.From(1, PressureChangeRateUnit.MegapascalPerSecond).MegapascalsPerSecond, MegapascalsPerSecondTolerance);
     AssertEx.EqualTolerance(1, PressureChangeRate.From(1, PressureChangeRateUnit.PascalPerSecond).PascalsPerSecond, PascalsPerSecondTolerance);
 }
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = PressureChangeRate.From(1, PressureChangeRateUnit.AtmospherePerSecond);

            AssertEx.EqualTolerance(1, quantity00.AtmospheresPerSecond, AtmospheresPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.AtmospherePerSecond, quantity00.Unit);

            var quantity01 = PressureChangeRate.From(1, PressureChangeRateUnit.KilopascalPerMinute);

            AssertEx.EqualTolerance(1, quantity01.KilopascalsPerMinute, KilopascalsPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.KilopascalPerMinute, quantity01.Unit);

            var quantity02 = PressureChangeRate.From(1, PressureChangeRateUnit.KilopascalPerSecond);

            AssertEx.EqualTolerance(1, quantity02.KilopascalsPerSecond, KilopascalsPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.KilopascalPerSecond, quantity02.Unit);

            var quantity03 = PressureChangeRate.From(1, PressureChangeRateUnit.MegapascalPerMinute);

            AssertEx.EqualTolerance(1, quantity03.MegapascalsPerMinute, MegapascalsPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.MegapascalPerMinute, quantity03.Unit);

            var quantity04 = PressureChangeRate.From(1, PressureChangeRateUnit.MegapascalPerSecond);

            AssertEx.EqualTolerance(1, quantity04.MegapascalsPerSecond, MegapascalsPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.MegapascalPerSecond, quantity04.Unit);

            var quantity05 = PressureChangeRate.From(1, PressureChangeRateUnit.PascalPerMinute);

            AssertEx.EqualTolerance(1, quantity05.PascalsPerMinute, PascalsPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.PascalPerMinute, quantity05.Unit);

            var quantity06 = PressureChangeRate.From(1, PressureChangeRateUnit.PascalPerSecond);

            AssertEx.EqualTolerance(1, quantity06.PascalsPerSecond, PascalsPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.PascalPerSecond, quantity06.Unit);
        }
Пример #3
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = PressureChangeRate.From(1, PressureChangeRateUnit.AtmospherePerSecond);

            AssertEx.EqualTolerance(1, quantity00.AtmospheresPerSecond, AtmospheresPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.AtmospherePerSecond, quantity00.Unit);

            var quantity01 = PressureChangeRate.From(1, PressureChangeRateUnit.KilopascalPerMinute);

            AssertEx.EqualTolerance(1, quantity01.KilopascalsPerMinute, KilopascalsPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.KilopascalPerMinute, quantity01.Unit);

            var quantity02 = PressureChangeRate.From(1, PressureChangeRateUnit.KilopascalPerSecond);

            AssertEx.EqualTolerance(1, quantity02.KilopascalsPerSecond, KilopascalsPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.KilopascalPerSecond, quantity02.Unit);

            var quantity03 = PressureChangeRate.From(1, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute);

            AssertEx.EqualTolerance(1, quantity03.KilopoundsForcePerSquareInchPerMinute, KilopoundsForcePerSquareInchPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute, quantity03.Unit);

            var quantity04 = PressureChangeRate.From(1, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond);

            AssertEx.EqualTolerance(1, quantity04.KilopoundsForcePerSquareInchPerSecond, KilopoundsForcePerSquareInchPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond, quantity04.Unit);

            var quantity05 = PressureChangeRate.From(1, PressureChangeRateUnit.MegapascalPerMinute);

            AssertEx.EqualTolerance(1, quantity05.MegapascalsPerMinute, MegapascalsPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.MegapascalPerMinute, quantity05.Unit);

            var quantity06 = PressureChangeRate.From(1, PressureChangeRateUnit.MegapascalPerSecond);

            AssertEx.EqualTolerance(1, quantity06.MegapascalsPerSecond, MegapascalsPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.MegapascalPerSecond, quantity06.Unit);

            var quantity07 = PressureChangeRate.From(1, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute);

            AssertEx.EqualTolerance(1, quantity07.MegapoundsForcePerSquareInchPerMinute, MegapoundsForcePerSquareInchPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute, quantity07.Unit);

            var quantity08 = PressureChangeRate.From(1, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond);

            AssertEx.EqualTolerance(1, quantity08.MegapoundsForcePerSquareInchPerSecond, MegapoundsForcePerSquareInchPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond, quantity08.Unit);

            var quantity09 = PressureChangeRate.From(1, PressureChangeRateUnit.PascalPerMinute);

            AssertEx.EqualTolerance(1, quantity09.PascalsPerMinute, PascalsPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.PascalPerMinute, quantity09.Unit);

            var quantity10 = PressureChangeRate.From(1, PressureChangeRateUnit.PascalPerSecond);

            AssertEx.EqualTolerance(1, quantity10.PascalsPerSecond, PascalsPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.PascalPerSecond, quantity10.Unit);

            var quantity11 = PressureChangeRate.From(1, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute);

            AssertEx.EqualTolerance(1, quantity11.PoundsForcePerSquareInchPerMinute, PoundsForcePerSquareInchPerMinuteTolerance);
            Assert.Equal(PressureChangeRateUnit.PoundForcePerSquareInchPerMinute, quantity11.Unit);

            var quantity12 = PressureChangeRate.From(1, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond);

            AssertEx.EqualTolerance(1, quantity12.PoundsForcePerSquareInchPerSecond, PoundsForcePerSquareInchPerSecondTolerance);
            Assert.Equal(PressureChangeRateUnit.PoundForcePerSquareInchPerSecond, quantity12.Unit);
        }