public void NewtonMeterPerMeterToTorquePerLengthUnits()
        {
            TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            AssertEx.EqualTolerance(KilogramForceCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.KilogramForceCentimetersPerMeter, KilogramForceCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilogramForceMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.KilogramForceMetersPerMeter, KilogramForceMetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilogramForceMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.KilogramForceMillimetersPerMeter, KilogramForceMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilonewtonCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.KilonewtonCentimetersPerMeter, KilonewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilonewtonMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.KilonewtonMetersPerMeter, KilonewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilonewtonMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.KilonewtonMillimetersPerMeter, KilonewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilopoundForceFeetPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.KilopoundForceFeetPerFoot, KilopoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(KilopoundForceInchesPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.KilopoundForceInchesPerFoot, KilopoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(MeganewtonCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.MeganewtonCentimetersPerMeter, MeganewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(MeganewtonMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.MeganewtonMetersPerMeter, MeganewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(MeganewtonMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.MeganewtonMillimetersPerMeter, MeganewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(MegapoundForceFeetPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.MegapoundForceFeetPerFoot, MegapoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(MegapoundForceInchesPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.MegapoundForceInchesPerFoot, MegapoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(NewtonCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.NewtonCentimetersPerMeter, NewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(NewtonMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(NewtonMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.NewtonMillimetersPerMeter, NewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(PoundForceFeetPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.PoundForceFeetPerFoot, PoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(PoundForceInchesPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.PoundForceInchesPerFoot, PoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(TonneForceCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.TonneForceCentimetersPerMeter, TonneForceCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(TonneForceMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.TonneForceMetersPerMeter, TonneForceMetersPerMeterTolerance);
            AssertEx.EqualTolerance(TonneForceMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.TonneForceMillimetersPerMeter, TonneForceMillimetersPerMeterTolerance);
        }
        public void EqualsRelativeToleranceIsImplemented()
        {
            var v = TorquePerLength.FromNewtonMetersPerMeter(1);

            Assert.True(v.Equals(TorquePerLength.FromNewtonMetersPerMeter(1), NewtonMetersPerMeterTolerance, ComparisonType.Relative));
            Assert.False(v.Equals(TorquePerLength.Zero, NewtonMetersPerMeterTolerance, ComparisonType.Relative));
        }
Beispiel #3
0
        public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
        {
            var quantity = new TorquePerLength();

            Assert.Equal(0, quantity.Value);
            Assert.Equal(TorquePerLengthUnit.NewtonMeterPerMeter, quantity.Unit);
        }
        public void ConversionRoundTrip()
        {
            TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            AssertEx.EqualTolerance(1, TorquePerLength.FromKilogramForceCentimetersPerMeter(newtonmeterpermeter.KilogramForceCentimetersPerMeter).NewtonMetersPerMeter, KilogramForceCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilogramForceMetersPerMeter(newtonmeterpermeter.KilogramForceMetersPerMeter).NewtonMetersPerMeter, KilogramForceMetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilogramForceMillimetersPerMeter(newtonmeterpermeter.KilogramForceMillimetersPerMeter).NewtonMetersPerMeter, KilogramForceMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilonewtonCentimetersPerMeter(newtonmeterpermeter.KilonewtonCentimetersPerMeter).NewtonMetersPerMeter, KilonewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilonewtonMetersPerMeter(newtonmeterpermeter.KilonewtonMetersPerMeter).NewtonMetersPerMeter, KilonewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilonewtonMillimetersPerMeter(newtonmeterpermeter.KilonewtonMillimetersPerMeter).NewtonMetersPerMeter, KilonewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilopoundForceFeetPerFoot(newtonmeterpermeter.KilopoundForceFeetPerFoot).NewtonMetersPerMeter, KilopoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromKilopoundForceInchesPerFoot(newtonmeterpermeter.KilopoundForceInchesPerFoot).NewtonMetersPerMeter, KilopoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromMeganewtonCentimetersPerMeter(newtonmeterpermeter.MeganewtonCentimetersPerMeter).NewtonMetersPerMeter, MeganewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromMeganewtonMetersPerMeter(newtonmeterpermeter.MeganewtonMetersPerMeter).NewtonMetersPerMeter, MeganewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromMeganewtonMillimetersPerMeter(newtonmeterpermeter.MeganewtonMillimetersPerMeter).NewtonMetersPerMeter, MeganewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromMegapoundForceFeetPerFoot(newtonmeterpermeter.MegapoundForceFeetPerFoot).NewtonMetersPerMeter, MegapoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromMegapoundForceInchesPerFoot(newtonmeterpermeter.MegapoundForceInchesPerFoot).NewtonMetersPerMeter, MegapoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromNewtonCentimetersPerMeter(newtonmeterpermeter.NewtonCentimetersPerMeter).NewtonMetersPerMeter, NewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromNewtonMetersPerMeter(newtonmeterpermeter.NewtonMetersPerMeter).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromNewtonMillimetersPerMeter(newtonmeterpermeter.NewtonMillimetersPerMeter).NewtonMetersPerMeter, NewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromPoundForceFeetPerFoot(newtonmeterpermeter.PoundForceFeetPerFoot).NewtonMetersPerMeter, PoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromPoundForceInchesPerFoot(newtonmeterpermeter.PoundForceInchesPerFoot).NewtonMetersPerMeter, PoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromTonneForceCentimetersPerMeter(newtonmeterpermeter.TonneForceCentimetersPerMeter).NewtonMetersPerMeter, TonneForceCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromTonneForceMetersPerMeter(newtonmeterpermeter.TonneForceMetersPerMeter).NewtonMetersPerMeter, TonneForceMetersPerMeterTolerance);
            AssertEx.EqualTolerance(1, TorquePerLength.FromTonneForceMillimetersPerMeter(newtonmeterpermeter.TonneForceMillimetersPerMeter).NewtonMetersPerMeter, TonneForceMillimetersPerMeterTolerance);
        }
        public void As()
        {
            var newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            AssertEx.EqualTolerance(KilogramForceCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilogramForceCentimeterPerMeter), KilogramForceCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilogramForceMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilogramForceMeterPerMeter), KilogramForceMetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilogramForceMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilogramForceMillimeterPerMeter), KilogramForceMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilonewtonCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilonewtonCentimeterPerMeter), KilonewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilonewtonMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilonewtonMeterPerMeter), KilonewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilonewtonMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilonewtonMillimeterPerMeter), KilonewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(KilopoundForceFeetPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilopoundForceFootPerFoot), KilopoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(KilopoundForceInchesPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.KilopoundForceInchPerFoot), KilopoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(MeganewtonCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.MeganewtonCentimeterPerMeter), MeganewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(MeganewtonMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.MeganewtonMeterPerMeter), MeganewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(MeganewtonMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.MeganewtonMillimeterPerMeter), MeganewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(MegapoundForceFeetPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.MegapoundForceFootPerFoot), MegapoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(MegapoundForceInchesPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.MegapoundForceInchPerFoot), MegapoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(NewtonCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.NewtonCentimeterPerMeter), NewtonCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(NewtonMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.NewtonMeterPerMeter), NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(NewtonMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.NewtonMillimeterPerMeter), NewtonMillimetersPerMeterTolerance);
            AssertEx.EqualTolerance(PoundForceFeetPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.PoundForceFootPerFoot), PoundForceFeetPerFootTolerance);
            AssertEx.EqualTolerance(PoundForceInchesPerFootInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.PoundForceInchPerFoot), PoundForceInchesPerFootTolerance);
            AssertEx.EqualTolerance(TonneForceCentimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.TonneForceCentimeterPerMeter), TonneForceCentimetersPerMeterTolerance);
            AssertEx.EqualTolerance(TonneForceMetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.TonneForceMeterPerMeter), TonneForceMetersPerMeterTolerance);
            AssertEx.EqualTolerance(TonneForceMillimetersPerMeterInOneNewtonMeterPerMeter, newtonmeterpermeter.As(TorquePerLengthUnit.TonneForceMillimeterPerMeter), TonneForceMillimetersPerMeterTolerance);
        }
        public void CompareToIsImplemented()
        {
            TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            Assert.Equal(0, newtonmeterpermeter.CompareTo(newtonmeterpermeter));
            Assert.True(newtonmeterpermeter.CompareTo(TorquePerLength.Zero) > 0);
            Assert.True(TorquePerLength.Zero.CompareTo(newtonmeterpermeter) < 0);
        }
        public void EqualsIsImplemented()
        {
            var a = TorquePerLength.FromNewtonMetersPerMeter(1);
            var b = TorquePerLength.FromNewtonMetersPerMeter(2);

            Assert.True(a.Equals(a));
            Assert.False(a.Equals(b));
            Assert.False(a.Equals(null));
        }
        public void ArithmeticOperators()
        {
            TorquePerLength v = TorquePerLength.FromNewtonMetersPerMeter(1);

            AssertEx.EqualTolerance(-1, -v.NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(2, (TorquePerLength.FromNewtonMetersPerMeter(3) - v).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(2, (v + v).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(10, (v * 10).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(10, (10 * v).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(2, (TorquePerLength.FromNewtonMetersPerMeter(10) / 5).NewtonMetersPerMeter, NewtonMetersPerMeterTolerance);
            AssertEx.EqualTolerance(2, TorquePerLength.FromNewtonMetersPerMeter(10) / TorquePerLength.FromNewtonMetersPerMeter(5), NewtonMetersPerMeterTolerance);
        }
        public void ComparisonOperators()
        {
            TorquePerLength oneNewtonMeterPerMeter  = TorquePerLength.FromNewtonMetersPerMeter(1);
            TorquePerLength twoNewtonMetersPerMeter = TorquePerLength.FromNewtonMetersPerMeter(2);

            Assert.True(oneNewtonMeterPerMeter < twoNewtonMetersPerMeter);
            Assert.True(oneNewtonMeterPerMeter <= twoNewtonMetersPerMeter);
            Assert.True(twoNewtonMetersPerMeter > oneNewtonMeterPerMeter);
            Assert.True(twoNewtonMetersPerMeter >= oneNewtonMeterPerMeter);

            Assert.False(oneNewtonMeterPerMeter > twoNewtonMetersPerMeter);
            Assert.False(oneNewtonMeterPerMeter >= twoNewtonMetersPerMeter);
            Assert.False(twoNewtonMetersPerMeter < oneNewtonMeterPerMeter);
            Assert.False(twoNewtonMetersPerMeter <= oneNewtonMeterPerMeter);
        }
        public void EqualityOperators()
        {
            var a = TorquePerLength.FromNewtonMetersPerMeter(1);
            var b = TorquePerLength.FromNewtonMetersPerMeter(2);

            // ReSharper disable EqualExpressionComparison

            Assert.True(a == a);
            Assert.False(a != a);

            Assert.True(a != b);
            Assert.False(a == b);

            Assert.False(a == null);
            Assert.False(null == a);

// ReSharper restore EqualExpressionComparison
        }
Beispiel #11
0
        public void TorquePerLength_QuantityInfo_ReturnsQuantityInfoDescribingQuantity()
        {
            var quantity = new TorquePerLength(1, TorquePerLengthUnit.NewtonMeterPerMeter);

            QuantityInfo <TorquePerLengthUnit> quantityInfo = quantity.QuantityInfo;

            Assert.Equal(TorquePerLength.Zero, quantityInfo.Zero);
            Assert.Equal("TorquePerLength", quantityInfo.Name);
            Assert.Equal(QuantityType.TorquePerLength, quantityInfo.QuantityType);

            var units     = EnumUtils.GetEnumValues <TorquePerLengthUnit>().Except(new[] { TorquePerLengthUnit.Undefined }).ToArray();
            var unitNames = units.Select(x => x.ToString());

            // Obsolete members
#pragma warning disable 618
            Assert.Equal(units, quantityInfo.Units);
            Assert.Equal(unitNames, quantityInfo.UnitNames);
#pragma warning restore 618
        }
 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);
 }
Beispiel #13
0
 public void NumberToNewtonMillimetersPerMeterTest() =>
 Assert.Equal(TorquePerLength.FromNewtonMillimetersPerMeter(2), 2.NewtonMillimetersPerMeter());
Beispiel #14
0
 public void NumberToMeganewtonMetersPerMeterTest() =>
 Assert.Equal(TorquePerLength.FromMeganewtonMetersPerMeter(2), 2.MeganewtonMetersPerMeter());
Beispiel #15
0
 public void NumberToMegapoundForceFeetPerFootTest() =>
 Assert.Equal(TorquePerLength.FromMegapoundForceFeetPerFoot(2), 2.MegapoundForceFeetPerFoot());
Beispiel #16
0
 public void NumberToKilonewtonMetersPerMeterTest() =>
 Assert.Equal(TorquePerLength.FromKilonewtonMetersPerMeter(2), 2.KilonewtonMetersPerMeter());
        public void CompareToThrowsOnNull()
        {
            TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            Assert.Throws <ArgumentNullException>(() => newtonmeterpermeter.CompareTo(null));
        }
Beispiel #18
0
 public static TorquePerLength NewtonMillimetersPerMeter <T>(this T value) =>
 TorquePerLength.FromNewtonMillimetersPerMeter(Convert.ToDouble(value));
Beispiel #19
0
 public void NumberToPoundForceInchesPerFootTest() =>
 Assert.Equal(TorquePerLength.FromPoundForceInchesPerFoot(2), 2.PoundForceInchesPerFoot());
 public static TorquePerLength DecanewtonMeterPerMeters <T>(this T value) =>
 TorquePerLength.FromDecanewtonMeterPerMeters(Convert.ToDouble(value));
Beispiel #21
0
 public void NumberToTonneForceCentimetersPerMeterTest() =>
 Assert.Equal(TorquePerLength.FromTonneForceCentimetersPerMeter(2), 2.TonneForceCentimetersPerMeter());
Beispiel #22
0
 public static TorquePerLength KilogramForceMillimetersPerMeter <T>(this T value) =>
 TorquePerLength.FromKilogramForceMillimetersPerMeter(Convert.ToDouble(value));
Beispiel #23
0
 public static TorquePerLength TonneForceMetersPerMeter <T>(this T value) =>
 TorquePerLength.FromTonneForceMetersPerMeter(Convert.ToDouble(value));
Beispiel #24
0
 public static TorquePerLength MeganewtonMetersPerMeter <T>(this T value) =>
 TorquePerLength.FromMeganewtonMetersPerMeter(Convert.ToDouble(value));
Beispiel #25
0
 public static TorquePerLength KilonewtonCentimetersPerMeter <T>(this T value) =>
 TorquePerLength.FromKilonewtonCentimetersPerMeter(Convert.ToDouble(value));
        public void EqualsReturnsFalseOnTypeMismatch()
        {
            TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            Assert.False(newtonmeterpermeter.Equals(new object()));
        }
Beispiel #27
0
 public static TorquePerLength MegapoundForceFeetPerFoot <T>(this T value) =>
 TorquePerLength.FromMegapoundForceFeetPerFoot(Convert.ToDouble(value));
        public void EqualsReturnsFalseOnNull()
        {
            TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1);

            Assert.False(newtonmeterpermeter.Equals(null));
        }
Beispiel #29
0
 public static TorquePerLength PoundForceInchesPerFoot <T>(this T value) =>
 TorquePerLength.FromPoundForceInchesPerFoot(Convert.ToDouble(value));
Beispiel #30
0
 public void NumberToKilogramForceMillimetersPerMeterTest() =>
 Assert.Equal(TorquePerLength.FromKilogramForceMillimetersPerMeter(2), 2.KilogramForceMillimetersPerMeter());