Ejemplo n.º 1
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = StandardFlow.From(1, StandardFlowUnit.StandardCubicCentimeterPerMinute);

            AssertEx.EqualTolerance(1, quantity00.StandardCubicCentimetersPerMinute, StandardCubicCentimetersPerMinuteTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicCentimeterPerMinute, quantity00.Unit);

            var quantity01 = StandardFlow.From(1, StandardFlowUnit.StandardCubicCentimeterPerSecond);

            AssertEx.EqualTolerance(1, quantity01.StandardCubicCentimetersPerSecond, StandardCubicCentimetersPerSecondTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicCentimeterPerSecond, quantity01.Unit);

            var quantity02 = StandardFlow.From(1, StandardFlowUnit.StandardCubicDecimeterPerMinute);

            AssertEx.EqualTolerance(1, quantity02.StandardCubicDecimetersPerMinute, StandardCubicDecimetersPerMinuteTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicDecimeterPerMinute, quantity02.Unit);

            var quantity03 = StandardFlow.From(1, StandardFlowUnit.StandardCubicFootPerDay);

            AssertEx.EqualTolerance(1, quantity03.StandardCubicFeetPerDay, StandardCubicFeetPerDayTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicFootPerDay, quantity03.Unit);

            var quantity04 = StandardFlow.From(1, StandardFlowUnit.StandardCubicFootPerHour);

            AssertEx.EqualTolerance(1, quantity04.StandardCubicFeetPerHour, StandardCubicFeetPerHourTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicFootPerHour, quantity04.Unit);

            var quantity05 = StandardFlow.From(1, StandardFlowUnit.StandardCubicFootPerMinute);

            AssertEx.EqualTolerance(1, quantity05.StandardCubicFeetPerMinute, StandardCubicFeetPerMinuteTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicFootPerMinute, quantity05.Unit);

            var quantity06 = StandardFlow.From(1, StandardFlowUnit.StandardCubicFootPerSecond);

            AssertEx.EqualTolerance(1, quantity06.StandardCubicFeetPerSecond, StandardCubicFeetPerSecondTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicFootPerSecond, quantity06.Unit);

            var quantity07 = StandardFlow.From(1, StandardFlowUnit.StandardCubicMeterPerDay);

            AssertEx.EqualTolerance(1, quantity07.StandardCubicMetersPerDay, StandardCubicMetersPerDayTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicMeterPerDay, quantity07.Unit);

            var quantity08 = StandardFlow.From(1, StandardFlowUnit.StandardCubicMeterPerHour);

            AssertEx.EqualTolerance(1, quantity08.StandardCubicMetersPerHour, StandardCubicMetersPerHourTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicMeterPerHour, quantity08.Unit);

            var quantity09 = StandardFlow.From(1, StandardFlowUnit.StandardCubicMeterPerMinute);

            AssertEx.EqualTolerance(1, quantity09.StandardCubicMetersPerMinute, StandardCubicMetersPerMinuteTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicMeterPerMinute, quantity09.Unit);

            var quantity10 = StandardFlow.From(1, StandardFlowUnit.StandardCubicMeterPerSecond);

            AssertEx.EqualTolerance(1, quantity10.StandardCubicMetersPerSecond, StandardCubicMetersPerSecondTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicMeterPerSecond, quantity10.Unit);

            var quantity11 = StandardFlow.From(1, StandardFlowUnit.StandardCubicMillimeterPerSecond);

            AssertEx.EqualTolerance(1, quantity11.StandardCubicMillimetersPerSecond, StandardCubicMillimetersPerSecondTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicMillimeterPerSecond, quantity11.Unit);

            var quantity12 = StandardFlow.From(1, StandardFlowUnit.StandardCubicYardPerDay);

            AssertEx.EqualTolerance(1, quantity12.StandardCubicYardsPerDay, StandardCubicYardsPerDayTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicYardPerDay, quantity12.Unit);

            var quantity13 = StandardFlow.From(1, StandardFlowUnit.StandardCubicYardPerHour);

            AssertEx.EqualTolerance(1, quantity13.StandardCubicYardsPerHour, StandardCubicYardsPerHourTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicYardPerHour, quantity13.Unit);

            var quantity14 = StandardFlow.From(1, StandardFlowUnit.StandardCubicYardPerMinute);

            AssertEx.EqualTolerance(1, quantity14.StandardCubicYardsPerMinute, StandardCubicYardsPerMinuteTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicYardPerMinute, quantity14.Unit);

            var quantity15 = StandardFlow.From(1, StandardFlowUnit.StandardCubicYardPerSecond);

            AssertEx.EqualTolerance(1, quantity15.StandardCubicYardsPerSecond, StandardCubicYardsPerSecondTolerance);
            Assert.Equal(StandardFlowUnit.StandardCubicYardPerSecond, quantity15.Unit);
        }