Lucene.Net.Index.TestSnapshotDeletionPolicy.AssertSnapshotExists C# (CSharp) Method

AssertSnapshotExists() protected method

protected AssertSnapshotExists ( Directory dir, Lucene.Net.Index.SnapshotDeletionPolicy sdp, int numSnapshots, bool checkIndexCommitSame ) : void
dir Directory
sdp Lucene.Net.Index.SnapshotDeletionPolicy
numSnapshots int
checkIndexCommitSame bool
return void
        protected internal virtual void AssertSnapshotExists(Directory dir, SnapshotDeletionPolicy sdp, int numSnapshots, bool checkIndexCommitSame)
        {
            for (int i = 0; i < numSnapshots; i++)
            {
                IndexCommit snapshot = Snapshots[i];
                CheckMaxDoc(snapshot, i + 1);
                CheckSnapshotExists(dir, snapshot);
                if (checkIndexCommitSame)
                {
                    Assert.AreSame(snapshot, sdp.GetIndexCommit(snapshot.Generation));
                }
                else
                {
                    Assert.AreEqual(snapshot.Generation, sdp.GetIndexCommit(snapshot.Generation).Generation);
                }
            }
        }