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