コード例 #1
0
        public void ConversionRoundTrip()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

            AssertEx.EqualTolerance(1, ForcePerLength.FromCentinewtonsPerMeter(newtonpermeter.CentinewtonsPerMeter).NewtonsPerMeter, CentinewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromDecanewtonsPerMeter(newtonpermeter.DecanewtonsPerMeter).NewtonsPerMeter, DecanewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromDecinewtonsPerMeter(newtonpermeter.DecinewtonsPerMeter).NewtonsPerMeter, DecinewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromExanewtonsPerMeter(newtonpermeter.ExanewtonsPerMeter).NewtonsPerMeter, ExanewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromFemtonewtonsPerMeter(newtonpermeter.FemtonewtonsPerMeter).NewtonsPerMeter, FemtonewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromGiganewtonsPerMeter(newtonpermeter.GiganewtonsPerMeter).NewtonsPerMeter, GiganewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromHectonewtonsPerMeter(newtonpermeter.HectonewtonsPerMeter).NewtonsPerMeter, HectonewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromKilogramsForcePerMeter(newtonpermeter.KilogramsForcePerMeter).NewtonsPerMeter, KilogramsForcePerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromKilonewtonsPerMeter(newtonpermeter.KilonewtonsPerMeter).NewtonsPerMeter, KilonewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromMeganewtonsPerMeter(newtonpermeter.MeganewtonsPerMeter).NewtonsPerMeter, MeganewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromMicronewtonsPerMeter(newtonpermeter.MicronewtonsPerMeter).NewtonsPerMeter, MicronewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromMillinewtonsPerMeter(newtonpermeter.MillinewtonsPerMeter).NewtonsPerMeter, MillinewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromNanonewtonsPerMeter(newtonpermeter.NanonewtonsPerMeter).NewtonsPerMeter, NanonewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromNewtonsPerMeter(newtonpermeter.NewtonsPerMeter).NewtonsPerMeter, NewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromPetanewtonsPerMeter(newtonpermeter.PetanewtonsPerMeter).NewtonsPerMeter, PetanewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromPiconewtonsPerMeter(newtonpermeter.PiconewtonsPerMeter).NewtonsPerMeter, PiconewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromQutranewtonsPerMeter(newtonpermeter.QutranewtonsPerMeter).NewtonsPerMeter, QutranewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromTeranewtonsPerMeter(newtonpermeter.TeranewtonsPerMeter).NewtonsPerMeter, TeranewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromVettanewtonsPerMeter(newtonpermeter.VettanewtonsPerMeter).NewtonsPerMeter, VettanewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromYottanewtonsPerMeter(newtonpermeter.YottanewtonsPerMeter).NewtonsPerMeter, YottanewtonsPerMeterTolerance);
            AssertEx.EqualTolerance(1, ForcePerLength.FromZettanewtonsPerMeter(newtonpermeter.ZettanewtonsPerMeter).NewtonsPerMeter, ZettanewtonsPerMeterTolerance);
        }