Ejemplo n.º 1
0
        public void CompareToShouldReturnPositiveValueWhenRightHappensBeforeLeft()
        {
            Stamp s1 = new Stamp();
            Stamp s2 = s1.Event();

            s2.CompareTo(s1).Should().BeGreaterThan(0);
        }
Ejemplo n.º 2
0
        public void CompareToShouldReturnZeroWhenComparingSeedStamps()
        {
            Stamp s1 = new Stamp();
            Stamp s2 = new Stamp();

            s1.CompareTo(s2).Should().Be(0);
        }
Ejemplo n.º 3
0
        public void CompareToShouldReturnNegativeValueWhenLeftHappensBeforeRight()
        {
            Stamp s1 = new Stamp();
            Stamp s2 = s1.Event();

            s1.CompareTo(s2).Should().BeLessThan(0);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 public int CompareTo(double stamp)
 {
     return(Stamp.CompareTo(stamp));
 }
Ejemplo n.º 6
0
 public int CompareTo(TimeSpan t)
 {
     return(Stamp.CompareTo(t.TotalSeconds));
 }
Ejemplo n.º 7
0
 public int CompareTo(TimeStamp t)
 {
     return(Stamp.CompareTo(t.Stamp));
 }
Ejemplo n.º 8
0
 public int CompareTo(Event other)
 {
     return(Stamp.CompareTo(other.Stamp));
 }