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