private static void VerifyHistory(Database db, RevisionInternal rev, IList <string > history) { RevisionInternal gotRev = db.GetDocumentWithIDAndRev(rev.GetDocId(), null, EnumSet .NoneOf <TDContentOptions>()); NUnit.Framework.Assert.AreEqual(rev, gotRev); NUnit.Framework.Assert.AreEqual(rev.Properties, gotRev.Properties); IList <RevisionInternal> revHistory = db.GetRevisionHistory(gotRev); NUnit.Framework.Assert.AreEqual(history.Count, revHistory.Count); for (int i = 0; i < history.Count; i++) { RevisionInternal hrev = revHistory[i]; NUnit.Framework.Assert.AreEqual(rev.GetDocId(), hrev.GetDocId()); NUnit.Framework.Assert.AreEqual(history[i], hrev.GetRevId()); NUnit.Framework.Assert.IsFalse(rev.IsDeleted()); } }
private void VerifyHistory(Database db, RevisionInternal rev, IList <string> history) { var gotRev = db.GetDocumentWithIDAndRev(rev.GetDocId(), null, DocumentContentOptions.None); Assert.AreEqual(rev, gotRev); AssertPropertiesAreEqual(rev.GetProperties(), gotRev.GetProperties()); var revHistory = db.GetRevisionHistory(gotRev); Assert.AreEqual(history.Count, revHistory.Count); for (int i = 0; i < history.Count; i++) { RevisionInternal hrev = revHistory[i]; Assert.AreEqual(rev.GetDocId(), hrev.GetDocId()); Assert.AreEqual(history[i], hrev.GetRevId()); Assert.IsFalse(rev.IsDeleted()); } }
private IEnumerable <SavedRevision> RevisionHistoryBackTo(IList <RevisionID> ancestors) { var history = new List <SavedRevision>(); foreach (var revID in Database.GetRevisionHistory(RevisionInternal, ancestors)) { SavedRevision revision; if (revID.Equals(RevisionInternal.RevID)) { revision = this; } else { revision = Document.GetRevisionWithId(revID, false); } history.Insert(0, revision); // reverse into forwards order } return(history); }
private static void VerifyHistory(Database db, RevisionInternal rev, IList<string > history) { RevisionInternal gotRev = db.GetDocumentWithIDAndRev(rev.GetDocId(), null, EnumSet .NoneOf<Database.TDContentOptions>()); NUnit.Framework.Assert.AreEqual(rev, gotRev); NUnit.Framework.Assert.AreEqual(rev.GetProperties(), gotRev.GetProperties()); IList<RevisionInternal> revHistory = db.GetRevisionHistory(gotRev); NUnit.Framework.Assert.AreEqual(history.Count, revHistory.Count); for (int i = 0; i < history.Count; i++) { RevisionInternal hrev = revHistory[i]; NUnit.Framework.Assert.AreEqual(rev.GetDocId(), hrev.GetDocId()); NUnit.Framework.Assert.AreEqual(history[i], hrev.GetRevId()); NUnit.Framework.Assert.IsFalse(rev.IsDeleted()); } }
private void VerifyHistory(Database db, RevisionInternal rev, IList<string> history) { var gotRev = db.GetDocumentWithIDAndRev(rev.GetDocId(), null, DocumentContentOptions.None); Assert.AreEqual(rev, gotRev); AssertPropertiesAreEqual(rev.GetProperties(), gotRev.GetProperties()); var revHistory = db.GetRevisionHistory(gotRev); Assert.AreEqual(history.Count, revHistory.Count); for (int i = 0; i < history.Count; i++) { RevisionInternal hrev = revHistory[i]; Assert.AreEqual(rev.GetDocId(), hrev.GetDocId()); Assert.AreEqual(history[i], hrev.GetRevId()); Assert.IsFalse(rev.IsDeleted()); } }