ElementMock.cs 534 B

12345678910111213141516
  1. using System;
  2. using QuestPDF.Drawing.SpacePlan;
  3. using QuestPDF.Infrastructure;
  4. namespace QuestPDF.UnitTests.TestEngine
  5. {
  6. internal class ElementMock : Element
  7. {
  8. public string Id { get; set; }
  9. public Func<Size, ISpacePlan> MeasureFunc { get; set; }
  10. public Action<Size> DrawFunc { get; set; }
  11. internal override ISpacePlan Measure(Size availableSpace) => MeasureFunc(availableSpace);
  12. internal override void Draw(ICanvas canvas, Size availableSpace) => DrawFunc(availableSpace);
  13. }
  14. }