public void CompareToIsImplemented() { TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1); Assert.Equal(0, newtonmeterpermeter.CompareTo(newtonmeterpermeter)); Assert.True(newtonmeterpermeter.CompareTo(TorquePerLength.Zero) > 0); Assert.True(TorquePerLength.Zero.CompareTo(newtonmeterpermeter) < 0); }
public void CompareToThrowsOnNull() { TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1); Assert.Throws <ArgumentNullException>(() => newtonmeterpermeter.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { TorquePerLength newtonmeterpermeter = TorquePerLength.FromNewtonMetersPerMeter(1); Assert.Throws <ArgumentException>(() => newtonmeterpermeter.CompareTo(new object())); }