Ejemplo n.º 1
0
        public void CompareToIsImplemented()
        {
            TemperatureCoefficient percentagebykelvin = TemperatureCoefficient.FromPercentageByKelvins(1);

            Assert.Equal(0, percentagebykelvin.CompareTo(percentagebykelvin));
            Assert.True(percentagebykelvin.CompareTo(TemperatureCoefficient.Zero) > 0);
            Assert.True(TemperatureCoefficient.Zero.CompareTo(percentagebykelvin) < 0);
        }
Ejemplo n.º 2
0
        public void CompareToThrowsOnNull()
        {
            TemperatureCoefficient percentagebykelvin = TemperatureCoefficient.FromPercentageByKelvins(1);

            Assert.Throws <ArgumentNullException>(() => percentagebykelvin.CompareTo(null));
        }
Ejemplo n.º 3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            TemperatureCoefficient percentagebykelvin = TemperatureCoefficient.FromPercentageByKelvins(1);

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