/// <summary> /// Integrates one or more operations into the Teletype document. /// </summary> /// <param name="replica">Teletype document instance</param> /// <param name="operations">Operations to integrate</param> protected void IntegrateOperations(TestDocument replica, IEnumerable <IOperation> operations) { var documentUpdates = replica.IntegrateOperations(operations.ToList()); replica.TestLocalDocument.UpdateText(documentUpdates.TextUpdates); replica.TestLocalDocument.UpdateMarkers(documentUpdates.MarkerUpdates); }
/// <summary> /// Creates a copy of the given Teletype document with new site identifier. /// </summary> /// <param name="siteId">Site identifier for the new document instance</param> /// <param name="document">Original Teletype document</param> /// <returns>Copy of the original document with new site identifier.</returns> protected TestDocument ReplicateDocument(int siteId, Document document) { var replica = new TestDocument(siteId); replica.IntegrateOperations(document.GetOperations().ToList()); replica.TestLocalDocument = new RawDocument(replica.GetText()); return(replica); }