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