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); }
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); }
public static SpecificVolume CubicFeetPerPound <T>(this T value) => SpecificVolume.FromCubicFeetPerPound(Convert.ToDecimal(value));
public static SpecificVolume?CubicFeetPerPound <T>(this T?value) where T : struct => SpecificVolume.FromCubicFeetPerPound(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void NumberToCubicFeetPerPoundTest() => Assert.Equal(SpecificVolume.FromCubicFeetPerPound(2), 2.CubicFeetPerPound());
/// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" /> public static SpecificVolume?CubicFeetPerPound(this decimal?value) => SpecificVolume.FromCubicFeetPerPound(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" /> public static SpecificVolume CubicFeetPerPound(this decimal value) => SpecificVolume.FromCubicFeetPerPound(Convert.ToDouble(value));
/// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" /> public static SpecificVolume?CubicFeetPerPound(this float?value) => SpecificVolume.FromCubicFeetPerPound(value);
/// <inheritdoc cref="SpecificVolume.FromCubicFeetPerPound(UnitsNet.QuantityValue)" /> public static SpecificVolume CubicFeetPerPound(this double value) => SpecificVolume.FromCubicFeetPerPound(value);