| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- namespace QuestPDF.LayoutTests;
- public class TableTests
- {
- [Test]
- public void RowSpan_CornerCase1()
- {
- LayoutTest
- .HavingSpaceOfSize(200, 400)
- .ForContent(content =>
- {
- content
- .Table(table =>
- {
- table.ColumnsDefinition(columns =>
- {
- columns.RelativeColumn();
- });
-
- table.Cell()
- .RowSpan(2)
- .Mock("a")
- .SolidBlock(100, 100);
-
- table.Cell()
- .Mock("b")
- .SolidBlock(100, 350);
- });
- })
- .ExpectDrawResult(document =>
- {
- document
- .Page()
- .RequiredAreaSize(200, 100)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(200, 100);
- });
-
- document
- .Page()
- .RequiredAreaSize(200, 350)
- .Content(page =>
- {
- page.Mock("b").Position(0, 0).Size(200, 350);
- });
- });
- }
-
- [Test]
- public void RowSpan_CornerCase2()
- {
- LayoutTest
- .HavingSpaceOfSize(200, 400)
- .ForContent(content =>
- {
- content
- .Table(table =>
- {
- table.ColumnsDefinition(columns =>
- {
- columns.RelativeColumn();
- columns.RelativeColumn();
- });
-
- table.Cell()
- .Column(1)
- .Row(1)
- .RowSpan(3)
- .Mock("a")
- .SolidBlock(100, 100);
-
- table.Cell()
- .Column(2)
- .Row(2)
- .Mock("b")
- .ContinuousBlock(100, 600);
- });
- })
- .ExpectDrawResult(document =>
- {
- document
- .Page()
- .RequiredAreaSize(200, 400)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(100, 400);
- page.Mock("b").Position(100, 0).Size(100, 400);
- });
-
- document
- .Page()
- .RequiredAreaSize(200, 200)
- .Content(page =>
- {
- page.Mock("a").Position(0, 0).Size(100, 200);
- page.Mock("b").Position(100, 0).Size(100, 200);
- });
- });
- }
- }
|