Exemple #1
0
        public void CompareToShouldReturnPositiveValueWhenRightHappensBeforeLeft()
        {
            Stamp s1 = new Stamp();
            Stamp s2 = s1.Event();

            s2.CompareTo(s1).Should().BeGreaterThan(0);
        }
Exemple #2
0
        public void CompareToShouldReturnZeroWhenComparingSeedStamps()
        {
            Stamp s1 = new Stamp();
            Stamp s2 = new Stamp();

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

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