Example #1
0
 public void CompareToIsImplemented()
 {
     CoefficientOfThermalExpansion inversekelvin = CoefficientOfThermalExpansion.FromInverseKelvin(1);
     Assert.Equal(0, inversekelvin.CompareTo(inversekelvin));
     Assert.True(inversekelvin.CompareTo(CoefficientOfThermalExpansion.Zero) > 0);
     Assert.True(CoefficientOfThermalExpansion.Zero.CompareTo(inversekelvin) < 0);
 }
        public void CompareToThrowsOnNull()
        {
            CoefficientOfThermalExpansion inversekelvin = CoefficientOfThermalExpansion.FromInverseKelvin(1);

            Assert.Throws <ArgumentNullException>(() => inversekelvin.CompareTo(null));
        }
        public void CompareToThrowsOnTypeMismatch()
        {
            CoefficientOfThermalExpansion inversekelvin = CoefficientOfThermalExpansion.FromInverseKelvin(1);

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