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