public void CompareToIsImplemented() { Pressure pascal = Pressure.FromPascals(1); Assert.Equal(0, pascal.CompareTo(pascal)); Assert.True(pascal.CompareTo(Pressure.Zero) > 0); Assert.True(Pressure.Zero.CompareTo(pascal) < 0); }
public void CompareToIsImplemented() { Pressure pascal = Pressure.FromPascals(1); Assert.AreEqual(0, pascal.CompareTo(pascal)); Assert.Greater(pascal.CompareTo(Pressure.Zero), 0); Assert.Less(Pressure.Zero.CompareTo(pascal), 0); }
public void CompareToThrowsOnNull() { Pressure pascal = Pressure.FromPascals(1); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed pascal.CompareTo(null); }
public void CompareToThrowsOnTypeMismatch() { Pressure pascal = Pressure.FromPascals(1); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed pascal.CompareTo(new object()); }
public void Compare() { Pressure a = Pressure.FromHectopascal(950.21); Pressure b = Pressure.FromHectopascal(920.59); Pressure c = Pressure.FromPascal(95021); Assert.NotEqual(a, b); Assert.True(a != b); Assert.True(a.CompareTo(b) > 0); Assert.True(a == c); Assert.True(b < a); Assert.True(a > b); Assert.True(a >= c); Assert.True(a <= c); Assert.False(a < b); }
public void CompareToThrowsOnNull() { Pressure pascal = Pressure.FromPascals(1); Assert.Throws <ArgumentNullException>(() => pascal.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { Pressure pascal = Pressure.FromPascals(1); Assert.Throws <ArgumentException>(() => pascal.CompareTo(new object())); }