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); }
public void CompareToThrowsOnNull() { TemperatureCoefficient percentagebykelvin = TemperatureCoefficient.FromPercentageByKelvins(1); Assert.Throws <ArgumentNullException>(() => percentagebykelvin.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { TemperatureCoefficient percentagebykelvin = TemperatureCoefficient.FromPercentageByKelvins(1); Assert.Throws <ArgumentException>(() => percentagebykelvin.CompareTo(new object())); }