public void CompareToWithSmallerFirstObject() { var first = new ValueAtTime <int>(new TimeMarker(10), 10); object second = new ValueAtTime <int>(new TimeMarker(20), 10); Assert.IsTrue(first.CompareTo(second) < 0); }
public void LargerThanOperatorWithEqualObjects() { var first = new ValueAtTime <int>(new TimeMarker(10), 10); var second = new ValueAtTime <int>(new TimeMarker(10), 10); Assert.IsFalse(first > second); }
public void CompareToWithUnequalObjectTypes() { var first = new ValueAtTime <int>(new TimeMarker(10), 10); var second = new object(); Assert.Throws <ArgumentException>(() => first.CompareTo(second)); }
public void CompareToOperatorWithEqualObjects() { var first = new ValueAtTime <int>(new TimeMarker(10), 10); object second = new ValueAtTime <int>(new TimeMarker(10), 10); Assert.AreEqual(0, first.CompareTo(second)); }
public void CompareToWithNullObject() { var first = new ValueAtTime <int>(new TimeMarker(10), 10); object second = null; Assert.AreEqual(1, first.CompareTo(second)); }
public void SmallerThanOperatorWithFirstObjectSmaller() { var first = new ValueAtTime <int>(new TimeMarker(10), 10); var second = new ValueAtTime <int>(new TimeMarker(20), 10); Assert.IsTrue(first < second); }
protected override ValueAtTime <int> Copy(ValueAtTime <int> original) { return(new ValueAtTime <int>(original.Time, original.Value)); }
public bool Equals(ValueAtTime <T> other) { return(m_Time == other.m_Time); }
/// <summary> /// Compares the current instance with another object of the same type and returns an integer that /// indicates whether the current instance precedes, follows, or occurs in the same position in the /// sort order as the other object. /// </summary> /// <param name="other">An object to compare with this instance.</param> /// <returns> /// A 32-bit signed integer that indicates the relative order of the objects being compared. /// The return value has these meanings: /// Value /// Meaning /// Less than zero /// This instance is less than <paramref name="other"/>. /// Zero /// This instance is equal to <paramref name="other"/>. /// Greater than zero /// This instance is greater than <paramref name="other"/>. /// </returns> public int CompareTo(ValueAtTime <T> other) { return(m_Time.CompareTo(other.m_Time)); }