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