Пример #1
0
 /// <summary>
 /// Fork this clock into two pieces that can be advanced independently and
 /// successfully joined with any other clock in the system.
 /// </summary>
 /// <param name="aLeft"></param>
 /// <param name="aRight"></param>
 public void Fork(out ItcStamp aLeft, out ItcStamp aRight)
 {
     ItcId leftId, rightId;
     iId.Split(out leftId, out rightId);
     aLeft = new ItcStamp(leftId, iEvent);
     aRight = new ItcStamp(rightId, iEvent);
 }
Пример #2
0
 private static ItcStamp ForkRight(ItcStamp aStamp)
 {
     ItcStamp left, right;
     aStamp.Fork(out left, out right);
     return right;
 }
Пример #3
0
 private static void Check(ItcStamp aStamp, string aToString)
 {
     Assert.That(
         aStamp.ToString(),
         Is.EqualTo(aToString));
 }
Пример #4
0
 /// <summary>
 /// Join two clocks. Result will compare greater or equal than everything
 /// previously forked from those clocks, but not ordered with anything
 /// </summary>
 /// <param name="aOther"></param>
 /// <returns></returns>
 public ItcStamp Join(ItcStamp aOther)
 {
     return new ItcStamp(
         iId.Sum(aOther.iId),
         iEvent.Join(aOther.iEvent));
 }
Пример #5
0
 /// <summary>
 /// Compare this timestamp to another. Return true if the other timestamp
 /// occurs causally after this one or is equal to it. Return false if the
 /// other timestamp is unordered or occurs causally before this one.
 /// </summary>
 /// <param name="aOther"></param>
 /// <returns></returns>
 public bool Leq(ItcStamp aOther)
 {
     return iEvent.Leq(aOther.iEvent);
 }
 public void TheRightTransactionsShouldBeReturned(
     int aRepositoryIndex,
     ItcStamp aTimestamp,
     params Transaction[] aExpectedTransactions)
 {
     var transactions = TestRigs[aRepositoryIndex].TransactionRepository.GetMissingTransactions(new Timestamp(aTimestamp.ToString())).ToList();
     Assert.That(transactions, Is.EqualTo(aExpectedTransactions));
 }