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