コード例 #1
0
        public void ConversionRoundTrip()
        {
            SpecificVolume cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(1, SpecificVolume.FromCubicFeetPerPound(cubicmeterperkilogram.CubicFeetPerPound).CubicMetersPerKilogram, CubicFeetPerPoundTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromCubicMetersPerKilogram(cubicmeterperkilogram.CubicMetersPerKilogram).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
        }
コード例 #2
0
        public void ConversionRoundTrip()
        {
            SpecificVolume cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(1, SpecificVolume.FromCenticubicMetersPerKilogram(cubicmeterperkilogram.CenticubicMetersPerKilogram).CubicMetersPerKilogram, CenticubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromCubicFeetPerPound(cubicmeterperkilogram.CubicFeetPerPound).CubicMetersPerKilogram, CubicFeetPerPoundTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromCubicMetersPerKilogram(cubicmeterperkilogram.CubicMetersPerKilogram).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromDecacubicMetersPerKilogram(cubicmeterperkilogram.DecacubicMetersPerKilogram).CubicMetersPerKilogram, DecacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromDecicubicMetersPerKilogram(cubicmeterperkilogram.DecicubicMetersPerKilogram).CubicMetersPerKilogram, DecicubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromExacubicMetersPerKilogram(cubicmeterperkilogram.ExacubicMetersPerKilogram).CubicMetersPerKilogram, ExacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromFemtocubicMetersPerKilogram(cubicmeterperkilogram.FemtocubicMetersPerKilogram).CubicMetersPerKilogram, FemtocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromGigacubicMetersPerKilogram(cubicmeterperkilogram.GigacubicMetersPerKilogram).CubicMetersPerKilogram, GigacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromHectocubicMetersPerKilogram(cubicmeterperkilogram.HectocubicMetersPerKilogram).CubicMetersPerKilogram, HectocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromKilocubicMetersPerKilogram(cubicmeterperkilogram.KilocubicMetersPerKilogram).CubicMetersPerKilogram, KilocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromMegacubicMetersPerKilogram(cubicmeterperkilogram.MegacubicMetersPerKilogram).CubicMetersPerKilogram, MegacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromMicrocubicMetersPerKilogram(cubicmeterperkilogram.MicrocubicMetersPerKilogram).CubicMetersPerKilogram, MicrocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromMillicubicMetersPerKilogram(cubicmeterperkilogram.MillicubicMetersPerKilogram).CubicMetersPerKilogram, MillicubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromNanocubicMetersPerKilogram(cubicmeterperkilogram.NanocubicMetersPerKilogram).CubicMetersPerKilogram, NanocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromPetacubicMetersPerKilogram(cubicmeterperkilogram.PetacubicMetersPerKilogram).CubicMetersPerKilogram, PetacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromPicocubicMetersPerKilogram(cubicmeterperkilogram.PicocubicMetersPerKilogram).CubicMetersPerKilogram, PicocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromQutracubicMetersPerKilogram(cubicmeterperkilogram.QutracubicMetersPerKilogram).CubicMetersPerKilogram, QutracubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromTeracubicMetersPerKilogram(cubicmeterperkilogram.TeracubicMetersPerKilogram).CubicMetersPerKilogram, TeracubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromVettacubicMetersPerKilogram(cubicmeterperkilogram.VettacubicMetersPerKilogram).CubicMetersPerKilogram, VettacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromYottacubicMetersPerKilogram(cubicmeterperkilogram.YottacubicMetersPerKilogram).CubicMetersPerKilogram, YottacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(1, SpecificVolume.FromZettacubicMetersPerKilogram(cubicmeterperkilogram.ZettacubicMetersPerKilogram).CubicMetersPerKilogram, ZettacubicMetersPerKilogramTolerance);
        }
コード例 #3
0
 public static SpecificVolume CubicFeetPerPound <T>(this T value) =>
 SpecificVolume.FromCubicFeetPerPound(Convert.ToDecimal(value));
コード例 #4
0
 public static SpecificVolume?CubicFeetPerPound <T>(this T?value) where T : struct => SpecificVolume.FromCubicFeetPerPound(value == null ? (double?)null : Convert.ToDouble(value.Value));
コード例 #5
0
 public void NumberToCubicFeetPerPoundTest() =>
 Assert.Equal(SpecificVolume.FromCubicFeetPerPound(2), 2.CubicFeetPerPound());
コード例 #6
0
 /// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" />
 public static SpecificVolume?CubicFeetPerPound(this decimal?value) => SpecificVolume.FromCubicFeetPerPound(value == null ? (double?)null : Convert.ToDouble(value.Value));
コード例 #7
0
 /// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" />
 public static SpecificVolume CubicFeetPerPound(this decimal value) => SpecificVolume.FromCubicFeetPerPound(Convert.ToDouble(value));
コード例 #8
0
 /// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" />
 public static SpecificVolume?CubicFeetPerPound(this float?value) => SpecificVolume.FromCubicFeetPerPound(value);
コード例 #9
0
 /// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" />
 public static SpecificVolume CubicFeetPerPound(this double value) => SpecificVolume.FromCubicFeetPerPound(value);