public void CubicMeterPerKilogramToSpecificVolumeUnits()
        {
            SpecificVolume cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(CubicFeetPerPoundInOneCubicMeterPerKilogram, cubicmeterperkilogram.CubicFeetPerPound, CubicFeetPerPoundTolerance);
            AssertEx.EqualTolerance(CubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
        }
        public void As()
        {
            var cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(CubicFeetPerPoundInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.CubicFootPerPound), CubicFeetPerPoundTolerance);
            AssertEx.EqualTolerance(CubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.CubicMeterPerKilogram), CubicMetersPerKilogramTolerance);
        }
        public void As()
        {
            var cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(CenticubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.CenticubicMeterPerKilogram), CenticubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(CubicFeetPerPoundInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.CubicFootPerPound), CubicFeetPerPoundTolerance);
            AssertEx.EqualTolerance(CubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.CubicMeterPerKilogram), CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(DecacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.DecacubicMeterPerKilogram), DecacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(DecicubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.DecicubicMeterPerKilogram), DecicubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(ExacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.ExacubicMeterPerKilogram), ExacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(FemtocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.FemtocubicMeterPerKilogram), FemtocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(GigacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.GigacubicMeterPerKilogram), GigacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(HectocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.HectocubicMeterPerKilogram), HectocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(KilocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.KilocubicMeterPerKilogram), KilocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(MegacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.MegacubicMeterPerKilogram), MegacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(MicrocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.MicrocubicMeterPerKilogram), MicrocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(MillicubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.MillicubicMeterPerKilogram), MillicubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(NanocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.NanocubicMeterPerKilogram), NanocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(PetacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.PetacubicMeterPerKilogram), PetacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(PicocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.PicocubicMeterPerKilogram), PicocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(QutracubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.QutracubicMeterPerKilogram), QutracubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(TeracubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.TeracubicMeterPerKilogram), TeracubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(VettacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.VettacubicMeterPerKilogram), VettacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(YottacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.YottacubicMeterPerKilogram), YottacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(ZettacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.As(SpecificVolumeUnit.ZettacubicMeterPerKilogram), ZettacubicMetersPerKilogramTolerance);
        }
        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 Equals_RelativeTolerance_IsImplemented()
        {
            var v = SpecificVolume.FromCubicMetersPerKilogram(1);

            Assert.True(v.Equals(SpecificVolume.FromCubicMetersPerKilogram(1), CubicMetersPerKilogramTolerance, ComparisonType.Relative));
            Assert.False(v.Equals(SpecificVolume.Zero, CubicMetersPerKilogramTolerance, ComparisonType.Relative));
        }
        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);
        }
Beispiel #7
0
        public void EqualsIsImplemented()
        {
            SpecificVolume v = SpecificVolume.FromCubicMetersPerKilogram(1);

            Assert.True(v.Equals(SpecificVolume.FromCubicMetersPerKilogram(1), SpecificVolume.FromCubicMetersPerKilogram(CubicMetersPerKilogramTolerance)));
            Assert.False(v.Equals(SpecificVolume.Zero, SpecificVolume.FromCubicMetersPerKilogram(CubicMetersPerKilogramTolerance)));
        }
        public void CubicMeterPerKilogramToSpecificVolumeUnits()
        {
            SpecificVolume cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(CenticubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.CenticubicMetersPerKilogram, CenticubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(CubicFeetPerPoundInOneCubicMeterPerKilogram, cubicmeterperkilogram.CubicFeetPerPound, CubicFeetPerPoundTolerance);
            AssertEx.EqualTolerance(CubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(DecacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.DecacubicMetersPerKilogram, DecacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(DecicubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.DecicubicMetersPerKilogram, DecicubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(ExacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.ExacubicMetersPerKilogram, ExacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(FemtocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.FemtocubicMetersPerKilogram, FemtocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(GigacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.GigacubicMetersPerKilogram, GigacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(HectocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.HectocubicMetersPerKilogram, HectocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(KilocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.KilocubicMetersPerKilogram, KilocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(MegacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.MegacubicMetersPerKilogram, MegacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(MicrocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.MicrocubicMetersPerKilogram, MicrocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(MillicubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.MillicubicMetersPerKilogram, MillicubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(NanocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.NanocubicMetersPerKilogram, NanocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(PetacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.PetacubicMetersPerKilogram, PetacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(PicocubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.PicocubicMetersPerKilogram, PicocubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(QutracubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.QutracubicMetersPerKilogram, QutracubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(TeracubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.TeracubicMetersPerKilogram, TeracubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(VettacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.VettacubicMetersPerKilogram, VettacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(YottacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.YottacubicMetersPerKilogram, YottacubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(ZettacubicMetersPerKilogramInOneCubicMeterPerKilogram, cubicmeterperkilogram.ZettacubicMetersPerKilogram, ZettacubicMetersPerKilogramTolerance);
        }
        public void FromCubicMetersPerKilogram_WithInfinityValue_CreateQuantityAndAffectInfinityValue()
        {
            var positiveInfinityQuantity = SpecificVolume.FromCubicMetersPerKilogram(double.PositiveInfinity);
            var negativeInfinityQuantity = SpecificVolume.FromCubicMetersPerKilogram(double.NegativeInfinity);

            Assert.True(double.IsPositiveInfinity(positiveInfinityQuantity.Value));
            Assert.True(double.IsNegativeInfinity(negativeInfinityQuantity.Value));
        }
        public void CompareToIsImplemented()
        {
            SpecificVolume cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            Assert.Equal(0, cubicmeterperkilogram.CompareTo(cubicmeterperkilogram));
            Assert.True(cubicmeterperkilogram.CompareTo(SpecificVolume.Zero) > 0);
            Assert.True(SpecificVolume.Zero.CompareTo(cubicmeterperkilogram) < 0);
        }
        public void Equals_SameType_IsImplemented()
        {
            var a = SpecificVolume.FromCubicMetersPerKilogram(1);
            var b = SpecificVolume.FromCubicMetersPerKilogram(2);

            Assert.True(a.Equals(a));
            Assert.False(a.Equals(b));
        }
        public void ToUnit()
        {
            var cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            var cubicmeterperkilogramQuantity = cubicmeterperkilogram.ToUnit(SpecificVolumeUnit.CubicMeterPerKilogram);

            AssertEx.EqualTolerance(CubicMetersPerKilogramInOneCubicMeterPerKilogram, (double)cubicmeterperkilogramQuantity.Value, CubicMetersPerKilogramTolerance);
            Assert.Equal(SpecificVolumeUnit.CubicMeterPerKilogram, cubicmeterperkilogramQuantity.Unit);
        }
        public void Equals_QuantityAsObject_IsImplemented()
        {
            object a = SpecificVolume.FromCubicMetersPerKilogram(1);
            object b = SpecificVolume.FromCubicMetersPerKilogram(2);

            Assert.True(a.Equals(a));
            Assert.False(a.Equals(b));
            Assert.False(a.Equals((object)null));
        }
Beispiel #14
0
        public void To_UnitSystem_ThrowsArgumentExceptionIfNotSupported()
        {
            var cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.SI));
            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.CGS));
            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.BI));
            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.EE));
            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.USC));
            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.FPS));
            Assert.Throws <ArgumentException>(() => cubicmeterperkilogram.ToUnit(UnitSystem.Astronomical));
        }
        public void ArithmeticOperators()
        {
            SpecificVolume v = SpecificVolume.FromCubicMetersPerKilogram(1);

            AssertEx.EqualTolerance(-1, -v.CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(2, (SpecificVolume.FromCubicMetersPerKilogram(3) - v).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(2, (v + v).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(10, (v * 10).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(10, (10 * v).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(2, (SpecificVolume.FromCubicMetersPerKilogram(10) / 5).CubicMetersPerKilogram, CubicMetersPerKilogramTolerance);
            AssertEx.EqualTolerance(2, SpecificVolume.FromCubicMetersPerKilogram(10) / SpecificVolume.FromCubicMetersPerKilogram(5), CubicMetersPerKilogramTolerance);
        }
Beispiel #16
0
        public void EqualityOperators()
        {
            SpecificVolume a = SpecificVolume.FromCubicMetersPerKilogram(1);
            SpecificVolume b = SpecificVolume.FromCubicMetersPerKilogram(2);

// ReSharper disable EqualExpressionComparison
            Assert.True(a == a);
            Assert.True(a != b);

            Assert.False(a == b);
            Assert.False(a != a);
// ReSharper restore EqualExpressionComparison
        }
        public void ComparisonOperators()
        {
            SpecificVolume oneCubicMeterPerKilogram  = SpecificVolume.FromCubicMetersPerKilogram(1);
            SpecificVolume twoCubicMetersPerKilogram = SpecificVolume.FromCubicMetersPerKilogram(2);

            Assert.True(oneCubicMeterPerKilogram < twoCubicMetersPerKilogram);
            Assert.True(oneCubicMeterPerKilogram <= twoCubicMetersPerKilogram);
            Assert.True(twoCubicMetersPerKilogram > oneCubicMeterPerKilogram);
            Assert.True(twoCubicMetersPerKilogram >= oneCubicMeterPerKilogram);

            Assert.False(oneCubicMeterPerKilogram > twoCubicMetersPerKilogram);
            Assert.False(oneCubicMeterPerKilogram >= twoCubicMetersPerKilogram);
            Assert.False(twoCubicMetersPerKilogram < oneCubicMeterPerKilogram);
            Assert.False(twoCubicMetersPerKilogram <= oneCubicMeterPerKilogram);
        }
        public void ToUnit()
        {
            var cubicmeterperkilogram = SpecificVolume.FromCubicMetersPerKilogram(1);

            var cubicfootperpoundQuantity = cubicmeterperkilogram.ToUnit(SpecificVolumeUnit.CubicFootPerPound);

            AssertEx.EqualTolerance(CubicFeetPerPoundInOneCubicMeterPerKilogram, (double)cubicfootperpoundQuantity.Value, CubicFeetPerPoundTolerance);
            Assert.Equal(SpecificVolumeUnit.CubicFootPerPound, cubicfootperpoundQuantity.Unit);

            var cubicmeterperkilogramQuantity = cubicmeterperkilogram.ToUnit(SpecificVolumeUnit.CubicMeterPerKilogram);

            AssertEx.EqualTolerance(CubicMetersPerKilogramInOneCubicMeterPerKilogram, (double)cubicmeterperkilogramQuantity.Value, CubicMetersPerKilogramTolerance);
            Assert.Equal(SpecificVolumeUnit.CubicMeterPerKilogram, cubicmeterperkilogramQuantity.Unit);

            var millicubicmeterperkilogramQuantity = cubicmeterperkilogram.ToUnit(SpecificVolumeUnit.MillicubicMeterPerKilogram);

            AssertEx.EqualTolerance(MillicubicMetersPerKilogramInOneCubicMeterPerKilogram, (double)millicubicmeterperkilogramQuantity.Value, MillicubicMetersPerKilogramTolerance);
            Assert.Equal(SpecificVolumeUnit.MillicubicMeterPerKilogram, millicubicmeterperkilogramQuantity.Unit);
        }
        public void EqualityOperators()
        {
            var a = SpecificVolume.FromCubicMetersPerKilogram(1);
            var b = SpecificVolume.FromCubicMetersPerKilogram(2);

#pragma warning disable CS8073
// 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
#pragma warning restore CS8073
        }
        public void Convert_ChangeType_QuantityType_EqualsQuantityType()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal(QuantityType.SpecificVolume, Convert.ChangeType(quantity, typeof(QuantityType)));
        }
        public void Convert_ChangeType_UnitType_EqualsUnit()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(SpecificVolumeUnit)));
        }
        public void Convert_ChangeType_SelfType_EqualsSelf()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(SpecificVolume)));
        }
        public void Convert_ToUInt64_EqualsValueAsSameType()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity));
        }
        public void Convert_ToString_EqualsToString()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal(quantity.ToString(), Convert.ToString(quantity));
        }
        public void GetHashCode_Equals()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal(new { SpecificVolume.QuantityType, quantity.Value, quantity.Unit }.GetHashCode(), quantity.GetHashCode());
        }
        public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal(SpecificVolume.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions)));
        }
        public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Throws <InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter)));
        }
        public void Convert_ToDecimal_EqualsValueAsSameType()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity));
        }
        public void NegationOperator_ReturnsQuantity_WithNegatedValue(double value)
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(value);

            Assert.Equal(SpecificVolume.FromCubicMetersPerKilogram(-value), -quantity);
        }
        public void Convert_ToSingle_EqualsValueAsSameType()
        {
            var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0);

            Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity));
        }