| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- namespace QuestPDF.LayoutTests;
- public class StopPagingTests
- {
- [Test]
- public void ChildReturnsWrap()
- {
- LayoutTest
- .HavingSpaceOfSize(100, 100)
- .ForContent(content =>
- {
- content.Shrink()
- .Mock("a")
- .StopPaging() // <-
- .Mock("b")
- .SolidBlock(200, 200);
- })
- .ExpectDrawResult(document =>
- {
- document
- .Page()
- .RequiredAreaSize(0, 0)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(0, 0);
- });
- });
- }
-
- [Test]
- public void ChildReturnsPartialRender()
- {
- LayoutTest
- .HavingSpaceOfSize(100, 100)
- .ForContent(content =>
- {
- content.Shrink()
- .Mock("a")
- .StopPaging() // <-
- .Mock("b")
- .ContinuousBlock(50, 150);
- })
- .ExpectDrawResult(document =>
- {
- document
- .Page()
- .RequiredAreaSize(50, 100)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(50, 100);
- page.Mock("b").Position(0, 0).Size(50, 100);
- });
-
- // remaining item space is ignored
- });
- }
-
- [Test]
- public void ChildReturnsFullRender()
- {
- LayoutTest
- .HavingSpaceOfSize(100, 100)
- .ForContent(content =>
- {
- content.Shrink()
- .Mock("a")
- .StopPaging() // <-
- .Mock("b")
- .SolidBlock(50, 50);
- })
- .ExpectDrawResult(document =>
- {
- document
- .Page()
- .RequiredAreaSize(50, 50)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(50, 50);
- page.Mock("b").Position(0, 0).Size(50, 50);
- });
- });
- }
-
- [Test]
- public void ChildReturnsEmpty()
- {
- LayoutTest
- .HavingSpaceOfSize(100, 100)
- .ForContent(content =>
- {
- content.Shrink()
- .Mock("a")
- .StopPaging() // <-
- .Mock("b");
- })
- .ExpectDrawResult(document =>
- {
- document
- .Page()
- .RequiredAreaSize(0, 0)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(0, 0);
- page.Mock("b").Position(0, 0).Size(0, 0);
- });
- });
- }
- }
|