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