public void CompareToIsImplemented() { ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1); Assert.Equal(0, newtonpermeter.CompareTo(newtonpermeter)); Assert.True(newtonpermeter.CompareTo(ForcePerLength.Zero) > 0); Assert.True(ForcePerLength.Zero.CompareTo(newtonpermeter) < 0); }
public void CompareToIsImplemented() { ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1); Assert.AreEqual(0, newtonpermeter.CompareTo(newtonpermeter)); Assert.Greater(newtonpermeter.CompareTo(ForcePerLength.Zero), 0); Assert.Less(ForcePerLength.Zero.CompareTo(newtonpermeter), 0); }
public void CompareToThrowsOnNull() { ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed newtonpermeter.CompareTo(null); }
public void CompareToThrowsOnTypeMismatch() { ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed newtonpermeter.CompareTo(new object()); }
public void CompareToThrowsOnNull() { ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1); Assert.Throws <ArgumentNullException>(() => newtonpermeter.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1); Assert.Throws <ArgumentException>(() => newtonpermeter.CompareTo(new object())); }