Beispiel #1
0
        public void CompareToIsImplemented()
        {
            MassFraction decimalfraction = MassFraction.FromDecimalFractions(1);

            Assert.Equal(0, decimalfraction.CompareTo(decimalfraction));
            Assert.True(decimalfraction.CompareTo(MassFraction.Zero) > 0);
            Assert.True(MassFraction.Zero.CompareTo(decimalfraction) < 0);
        }
Beispiel #2
0
        public void CompareToThrowsOnNull()
        {
            MassFraction decimalfraction = MassFraction.FromDecimalFractions(1);

            Assert.Throws <ArgumentNullException>(() => decimalfraction.CompareTo(null));
        }
Beispiel #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            MassFraction decimalfraction = MassFraction.FromDecimalFractions(1);

            Assert.Throws <ArgumentException>(() => decimalfraction.CompareTo(new object()));
        }