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