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