Esempio n. 1
0
        public void CompareToIsImplemented()
        {
            VolumePerLength cubicmeterpermeter = VolumePerLength.FromCubicMetersPerMeter(1);

            Assert.Equal(0, cubicmeterpermeter.CompareTo(cubicmeterpermeter));
            Assert.True(cubicmeterpermeter.CompareTo(VolumePerLength.Zero) > 0);
            Assert.True(VolumePerLength.Zero.CompareTo(cubicmeterpermeter) < 0);
        }
Esempio n. 2
0
        public void CompareToThrowsOnNull()
        {
            VolumePerLength cubicmeterpermeter = VolumePerLength.FromCubicMetersPerMeter(1);

            Assert.Throws <ArgumentNullException>(() => cubicmeterpermeter.CompareTo(null));
        }
Esempio n. 3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            VolumePerLength cubicmeterpermeter = VolumePerLength.FromCubicMetersPerMeter(1);

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