public void CompareToShouldReturnPositiveValueWhenRightHappensBeforeLeft() { Stamp s1 = new Stamp(); Stamp s2 = s1.Event(); s2.CompareTo(s1).Should().BeGreaterThan(0); }
public void CompareToShouldReturnZeroWhenComparingSeedStamps() { Stamp s1 = new Stamp(); Stamp s2 = new Stamp(); s1.CompareTo(s2).Should().Be(0); }
public void CompareToShouldReturnNegativeValueWhenLeftHappensBeforeRight() { Stamp s1 = new Stamp(); Stamp s2 = s1.Event(); s1.CompareTo(s2).Should().BeLessThan(0); }
public void CompareToShouldReturnZeroWhenComparingCausallyEqualStampsWithDifferentIds() { // Bug fix: The initial implementation used the Equal method to perform the compare // as equal (0); however, that method performs a structural comparison of both the // id and event. CompareTo must return 0 when 2 stamps are equivalent (causally equal). Stamp s1 = ((1, 0), (0, 1, 0)); Stamp s2 = ((0, 1), (0, 1, 0)); s1.CompareTo(s2).Should().Be(0); }
public int CompareTo(double stamp) { return(Stamp.CompareTo(stamp)); }
public int CompareTo(TimeSpan t) { return(Stamp.CompareTo(t.TotalSeconds)); }
public int CompareTo(TimeStamp t) { return(Stamp.CompareTo(t.Stamp)); }
public int CompareTo(Event other) { return(Stamp.CompareTo(other.Stamp)); }