public void FromValueAndUnit() { AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.CentinewtonPerMeter).CentinewtonsPerMeter, CentinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.DecinewtonPerMeter).DecinewtonsPerMeter, DecinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.KilogramForcePerMeter).KilogramsForcePerMeter, KilogramsForcePerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.KilonewtonPerMeter).KilonewtonsPerMeter, KilonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MicronewtonPerMeter).MicronewtonsPerMeter, MicronewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MillinewtonPerMeter).MillinewtonsPerMeter, MillinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.NanonewtonPerMeter).NanonewtonsPerMeter, NanonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.NewtonPerMeter).NewtonsPerMeter, NewtonsPerMeterTolerance); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.CentinewtonPerMeter).CentinewtonsPerMeter, CentinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.DecinewtonPerMeter).DecinewtonsPerMeter, DecinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.KilogramForcePerMeter).KilogramsForcePerMeter, KilogramsForcePerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.KilonewtonPerMeter).KilonewtonsPerMeter, KilonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MeganewtonPerMeter).MeganewtonsPerMeter, MeganewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MicronewtonPerMeter).MicronewtonsPerMeter, MicronewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MillinewtonPerMeter).MillinewtonsPerMeter, MillinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.NanonewtonPerMeter).NanonewtonsPerMeter, NanonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.NewtonPerMeter).NewtonsPerMeter, NewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.PoundForcePerFoot).PoundsForcePerFoot, PoundsForcePerFootTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.PoundForcePerInch).PoundsForcePerInch, PoundsForcePerInchTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.PoundForcePerYard).PoundsForcePerYard, PoundsForcePerYardTolerance); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.CentinewtonPerMeter).CentinewtonsPerMeter, CentinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.DecanewtonPerMeter).DecanewtonsPerMeter, DecanewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.DecinewtonPerMeter).DecinewtonsPerMeter, DecinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.ExanewtonPerMeter).ExanewtonsPerMeter, ExanewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.FemtonewtonPerMeter).FemtonewtonsPerMeter, FemtonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.GiganewtonPerMeter).GiganewtonsPerMeter, GiganewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.HectonewtonPerMeter).HectonewtonsPerMeter, HectonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.KilogramForcePerMeter).KilogramsForcePerMeter, KilogramsForcePerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.KilonewtonPerMeter).KilonewtonsPerMeter, KilonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MeganewtonPerMeter).MeganewtonsPerMeter, MeganewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MicronewtonPerMeter).MicronewtonsPerMeter, MicronewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.MillinewtonPerMeter).MillinewtonsPerMeter, MillinewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.NanonewtonPerMeter).NanonewtonsPerMeter, NanonewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.NewtonPerMeter).NewtonsPerMeter, NewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.PetanewtonPerMeter).PetanewtonsPerMeter, PetanewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.PiconewtonPerMeter).PiconewtonsPerMeter, PiconewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.QutranewtonPerMeter).QutranewtonsPerMeter, QutranewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.TeranewtonPerMeter).TeranewtonsPerMeter, TeranewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.VettanewtonPerMeter).VettanewtonsPerMeter, VettanewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.YottanewtonPerMeter).YottanewtonsPerMeter, YottanewtonsPerMeterTolerance); AssertEx.EqualTolerance(1, ForcePerLength.From(1, ForcePerLengthUnit.ZettanewtonPerMeter).ZettanewtonsPerMeter, ZettanewtonsPerMeterTolerance); }
public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() { var quantity00 = ForcePerLength.From(1, ForcePerLengthUnit.CentinewtonPerMeter); AssertEx.EqualTolerance(1, quantity00.CentinewtonsPerMeter, CentinewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.CentinewtonPerMeter, quantity00.Unit); var quantity01 = ForcePerLength.From(1, ForcePerLengthUnit.DecinewtonPerMeter); AssertEx.EqualTolerance(1, quantity01.DecinewtonsPerMeter, DecinewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.DecinewtonPerMeter, quantity01.Unit); var quantity02 = ForcePerLength.From(1, ForcePerLengthUnit.KilogramForcePerMeter); AssertEx.EqualTolerance(1, quantity02.KilogramsForcePerMeter, KilogramsForcePerMeterTolerance); Assert.Equal(ForcePerLengthUnit.KilogramForcePerMeter, quantity02.Unit); var quantity03 = ForcePerLength.From(1, ForcePerLengthUnit.KilonewtonPerMeter); AssertEx.EqualTolerance(1, quantity03.KilonewtonsPerMeter, KilonewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.KilonewtonPerMeter, quantity03.Unit); var quantity04 = ForcePerLength.From(1, ForcePerLengthUnit.MeganewtonPerMeter); AssertEx.EqualTolerance(1, quantity04.MeganewtonsPerMeter, MeganewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.MeganewtonPerMeter, quantity04.Unit); var quantity05 = ForcePerLength.From(1, ForcePerLengthUnit.MicronewtonPerMeter); AssertEx.EqualTolerance(1, quantity05.MicronewtonsPerMeter, MicronewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.MicronewtonPerMeter, quantity05.Unit); var quantity06 = ForcePerLength.From(1, ForcePerLengthUnit.MillinewtonPerMeter); AssertEx.EqualTolerance(1, quantity06.MillinewtonsPerMeter, MillinewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.MillinewtonPerMeter, quantity06.Unit); var quantity07 = ForcePerLength.From(1, ForcePerLengthUnit.NanonewtonPerMeter); AssertEx.EqualTolerance(1, quantity07.NanonewtonsPerMeter, NanonewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.NanonewtonPerMeter, quantity07.Unit); var quantity08 = ForcePerLength.From(1, ForcePerLengthUnit.NewtonPerMeter); AssertEx.EqualTolerance(1, quantity08.NewtonsPerMeter, NewtonsPerMeterTolerance); Assert.Equal(ForcePerLengthUnit.NewtonPerMeter, quantity08.Unit); var quantity09 = ForcePerLength.From(1, ForcePerLengthUnit.PoundForcePerFoot); AssertEx.EqualTolerance(1, quantity09.PoundsForcePerFoot, PoundsForcePerFootTolerance); Assert.Equal(ForcePerLengthUnit.PoundForcePerFoot, quantity09.Unit); var quantity10 = ForcePerLength.From(1, ForcePerLengthUnit.PoundForcePerInch); AssertEx.EqualTolerance(1, quantity10.PoundsForcePerInch, PoundsForcePerInchTolerance); Assert.Equal(ForcePerLengthUnit.PoundForcePerInch, quantity10.Unit); var quantity11 = ForcePerLength.From(1, ForcePerLengthUnit.PoundForcePerYard); AssertEx.EqualTolerance(1, quantity11.PoundsForcePerYard, PoundsForcePerYardTolerance); Assert.Equal(ForcePerLengthUnit.PoundForcePerYard, quantity11.Unit); }