public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilogramForceCentimeterPerMeter).KilogramForceCentimetersPerMeter, KilogramForceCentimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilogramForceMeterPerMeter).KilogramForceMetersPerMeter, KilogramForceMetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilogramForceMillimeterPerMeter).KilogramForceMillimetersPerMeter, KilogramForceMillimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilonewtonCentimeterPerMeter).KilonewtonCentimetersPerMeter, KilonewtonCentimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilonewtonMeterPerMeter).KilonewtonMetersPerMeter, KilonewtonMetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilonewtonMillimeterPerMeter).KilonewtonMillimetersPerMeter, KilonewtonMillimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilopoundForceFootPerFoot).KilopoundForceFeetPerFoot, KilopoundForceFeetPerFootTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.KilopoundForceInchPerFoot).KilopoundForceInchesPerFoot, KilopoundForceInchesPerFootTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.MeganewtonCentimeterPerMeter).MeganewtonCentimetersPerMeter, MeganewtonCentimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.MeganewtonMeterPerMeter).MeganewtonMetersPerMeter, MeganewtonMetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.MeganewtonMillimeterPerMeter).MeganewtonMillimetersPerMeter, MeganewtonMillimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.MegapoundForceFootPerFoot).MegapoundForceFeetPerFoot, MegapoundForceFeetPerFootTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.MegapoundForceInchPerFoot).MegapoundForceInchesPerFoot, MegapoundForceInchesPerFootTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.NewtonCentimeterPerMeter).NewtonCentimetersPerMeter, NewtonCentimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.NewtonMeterPerMeter).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.NewtonMillimeterPerMeter).NewtonMillimetersPerMeter, NewtonMillimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.PoundForceFootPerFoot).PoundForceFeetPerFoot, PoundForceFeetPerFootTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.PoundForceInchPerFoot).PoundForceInchesPerFoot, PoundForceInchesPerFootTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.TonneForceCentimeterPerMeter).TonneForceCentimetersPerMeter, TonneForceCentimetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.TonneForceMeterPerMeter).TonneForceMetersPerMeter, TonneForceMetersPerMeterTolerance);
     AssertEx.EqualTolerance(1, TorquePerLength.From(1, TorquePerLengthUnit.TonneForceMillimeterPerMeter).TonneForceMillimetersPerMeter, TonneForceMillimetersPerMeterTolerance);
 }
Ejemplo n.º 2
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = TorquePerLength.From(1, TorquePerLengthUnit.KilogramForceCentimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity00.KilogramForceCentimetersPerMeter, KilogramForceCentimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.KilogramForceCentimeterPerMeter, quantity00.Unit);

            var quantity01 = TorquePerLength.From(1, TorquePerLengthUnit.KilogramForceMeterPerMeter);

            AssertEx.EqualTolerance(1, quantity01.KilogramForceMetersPerMeter, KilogramForceMetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.KilogramForceMeterPerMeter, quantity01.Unit);

            var quantity02 = TorquePerLength.From(1, TorquePerLengthUnit.KilogramForceMillimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity02.KilogramForceMillimetersPerMeter, KilogramForceMillimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.KilogramForceMillimeterPerMeter, quantity02.Unit);

            var quantity03 = TorquePerLength.From(1, TorquePerLengthUnit.KilonewtonCentimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity03.KilonewtonCentimetersPerMeter, KilonewtonCentimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.KilonewtonCentimeterPerMeter, quantity03.Unit);

            var quantity04 = TorquePerLength.From(1, TorquePerLengthUnit.KilonewtonMeterPerMeter);

            AssertEx.EqualTolerance(1, quantity04.KilonewtonMetersPerMeter, KilonewtonMetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.KilonewtonMeterPerMeter, quantity04.Unit);

            var quantity05 = TorquePerLength.From(1, TorquePerLengthUnit.KilonewtonMillimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity05.KilonewtonMillimetersPerMeter, KilonewtonMillimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.KilonewtonMillimeterPerMeter, quantity05.Unit);

            var quantity06 = TorquePerLength.From(1, TorquePerLengthUnit.KilopoundForceFootPerFoot);

            AssertEx.EqualTolerance(1, quantity06.KilopoundForceFeetPerFoot, KilopoundForceFeetPerFootTolerance);
            Assert.Equal(TorquePerLengthUnit.KilopoundForceFootPerFoot, quantity06.Unit);

            var quantity07 = TorquePerLength.From(1, TorquePerLengthUnit.KilopoundForceInchPerFoot);

            AssertEx.EqualTolerance(1, quantity07.KilopoundForceInchesPerFoot, KilopoundForceInchesPerFootTolerance);
            Assert.Equal(TorquePerLengthUnit.KilopoundForceInchPerFoot, quantity07.Unit);

            var quantity08 = TorquePerLength.From(1, TorquePerLengthUnit.MeganewtonCentimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity08.MeganewtonCentimetersPerMeter, MeganewtonCentimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.MeganewtonCentimeterPerMeter, quantity08.Unit);

            var quantity09 = TorquePerLength.From(1, TorquePerLengthUnit.MeganewtonMeterPerMeter);

            AssertEx.EqualTolerance(1, quantity09.MeganewtonMetersPerMeter, MeganewtonMetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.MeganewtonMeterPerMeter, quantity09.Unit);

            var quantity10 = TorquePerLength.From(1, TorquePerLengthUnit.MeganewtonMillimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity10.MeganewtonMillimetersPerMeter, MeganewtonMillimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.MeganewtonMillimeterPerMeter, quantity10.Unit);

            var quantity11 = TorquePerLength.From(1, TorquePerLengthUnit.MegapoundForceFootPerFoot);

            AssertEx.EqualTolerance(1, quantity11.MegapoundForceFeetPerFoot, MegapoundForceFeetPerFootTolerance);
            Assert.Equal(TorquePerLengthUnit.MegapoundForceFootPerFoot, quantity11.Unit);

            var quantity12 = TorquePerLength.From(1, TorquePerLengthUnit.MegapoundForceInchPerFoot);

            AssertEx.EqualTolerance(1, quantity12.MegapoundForceInchesPerFoot, MegapoundForceInchesPerFootTolerance);
            Assert.Equal(TorquePerLengthUnit.MegapoundForceInchPerFoot, quantity12.Unit);

            var quantity13 = TorquePerLength.From(1, TorquePerLengthUnit.NewtonCentimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity13.NewtonCentimetersPerMeter, NewtonCentimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.NewtonCentimeterPerMeter, quantity13.Unit);

            var quantity14 = TorquePerLength.From(1, TorquePerLengthUnit.NewtonMeterPerMeter);

            AssertEx.EqualTolerance(1, quantity14.NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.NewtonMeterPerMeter, quantity14.Unit);

            var quantity15 = TorquePerLength.From(1, TorquePerLengthUnit.NewtonMillimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity15.NewtonMillimetersPerMeter, NewtonMillimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.NewtonMillimeterPerMeter, quantity15.Unit);

            var quantity16 = TorquePerLength.From(1, TorquePerLengthUnit.PoundForceFootPerFoot);

            AssertEx.EqualTolerance(1, quantity16.PoundForceFeetPerFoot, PoundForceFeetPerFootTolerance);
            Assert.Equal(TorquePerLengthUnit.PoundForceFootPerFoot, quantity16.Unit);

            var quantity17 = TorquePerLength.From(1, TorquePerLengthUnit.PoundForceInchPerFoot);

            AssertEx.EqualTolerance(1, quantity17.PoundForceInchesPerFoot, PoundForceInchesPerFootTolerance);
            Assert.Equal(TorquePerLengthUnit.PoundForceInchPerFoot, quantity17.Unit);

            var quantity18 = TorquePerLength.From(1, TorquePerLengthUnit.TonneForceCentimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity18.TonneForceCentimetersPerMeter, TonneForceCentimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.TonneForceCentimeterPerMeter, quantity18.Unit);

            var quantity19 = TorquePerLength.From(1, TorquePerLengthUnit.TonneForceMeterPerMeter);

            AssertEx.EqualTolerance(1, quantity19.TonneForceMetersPerMeter, TonneForceMetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.TonneForceMeterPerMeter, quantity19.Unit);

            var quantity20 = TorquePerLength.From(1, TorquePerLengthUnit.TonneForceMillimeterPerMeter);

            AssertEx.EqualTolerance(1, quantity20.TonneForceMillimetersPerMeter, TonneForceMillimetersPerMeterTolerance);
            Assert.Equal(TorquePerLengthUnit.TonneForceMillimeterPerMeter, quantity20.Unit);
        }