コード例 #1
0
ファイル: HeightTests.cs プロジェクト: Amichai/PhysicsPad
 internal static void CheckHeights(TextDocument document, HeightTree heightTree)
 {
     double[] heights         = document.Lines.Select(l => heightTree.GetIsCollapsed(l) ? 0 : heightTree.GetHeight(l)).ToArray();
     double[] visualPositions = new double[document.LineCount + 1];
     for (int i = 0; i < heights.Length; i++)
     {
         visualPositions[i + 1] = visualPositions[i] + heights[i];
     }
     foreach (DocumentLine ls in document.Lines)
     {
         Assert.AreEqual(visualPositions[ls.LineNumber - 1], heightTree.GetVisualPosition(ls));
     }
     Assert.AreEqual(visualPositions[document.LineCount], heightTree.TotalHeight);
 }