private void VerifyDraw(List<object> drawActions, ref int position, FakeSegment seg, int srcLeft, int srcTop) { var drawAction = drawActions[position++] as FakeSegment.DrawTextAction; Assert.That(drawAction, Is.Not.Null); Assert.That(drawAction, Is.Not.TypeOf(typeof(FakeSegment.DrawTextNoBackgroundAction))); Assert.That(drawAction.Segment, Is.EqualTo(seg)); Assert.That(drawAction.RcSrc.left, Is.EqualTo(-srcLeft)); Assert.That(drawAction.RcSrc.top, Is.EqualTo(-srcTop)); // These come from the paint transform set up in SetupFakeRootSite, and are constant throughout this test. Assert.That(drawAction.RcDst.left, Is.EqualTo(-100)); Assert.That(drawAction.RcDst.top, Is.EqualTo(-200)); // for this test dpi is fixed at 96. Assert.That(drawAction.RcSrc.right, Is.EqualTo(drawAction.RcSrc.left + 96)); Assert.That(drawAction.RcSrc.bottom, Is.EqualTo(drawAction.RcSrc.top + 96)); Assert.That(drawAction.RcDst.right, Is.EqualTo(drawAction.RcDst.left + 96)); Assert.That(drawAction.RcDst.bottom, Is.EqualTo(drawAction.RcDst.top + 96)); }
private void VerifyDraw(List<object> drawActions, ref int position, FakeSegment seg) { var drawAction = drawActions[position++] as FakeSegment.DrawTextAction; Assert.That(drawAction, Is.Not.Null); Assert.That(drawAction, Is.Not.TypeOf(typeof(FakeSegment.DrawTextNoBackgroundAction))); Assert.That(drawAction.Segment, Is.EqualTo(seg)); }
private void VerifyRangeSegmentQuery(ParaBox para, StringBox stringBox, FakeSegment seg, int ichMin, int ichLim, int top, int ydTop, int bottom) { var args = seg.LastPositionOfRangeArgs; VerifyRangeDrawingArgs(args, stringBox, ichMin, ichLim, top, ydTop, bottom); }
private void VerifyCharPlacementCall(FakeSegment seg1, int ichBase, int ichMin, int ichLim, Rect rcSrc, Rect rcDst, IVwGraphics vg, int cxdMax) { Assert.That(seg1.PrevCharPlacementArgs.Count, Is.GreaterThan(0)); var args = seg1.PrevCharPlacementArgs[0]; seg1.PrevCharPlacementArgs.RemoveAt(0); // having verified it, make ready to verify next, if any. Assert.That(args.IchBase, Is.EqualTo(ichBase)); Assert.That(args.IchMin, Is.EqualTo(ichMin)); Assert.That(args.IchLim, Is.EqualTo(ichLim)); Assert.That(args.RcSrc, Is.EqualTo(rcSrc)); Assert.That(args.RcDst, Is.EqualTo(rcDst)); Assert.That(args.Vg, Is.EqualTo(vg)); Assert.That(args.CxdMax, Is.EqualTo(cxdMax)); }
private void VerifyRangeSegmentDrawing(ParaBox para, StringBox stringBox, FakeSegment seg, int ichMin, int ichLim, int top, int ydTop, int bottom) { var args = seg.LastDrawRangeCall; VerifyRangeDrawingArgs(args, stringBox, ichMin, ichLim, top, ydTop, bottom); }