예제 #1
0
파일: ItcStamp.cs 프로젝트: weeble/ohos
 /// <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
파일: ItcStamp.cs 프로젝트: weeble/ohos
 /// <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
파일: ItcStamp.cs 프로젝트: weeble/ohos
 /// <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));
 }