| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using QuestPDF.Drawing;
- using QuestPDF.Fluent;
- using QuestPDF.Infrastructure;
- namespace QuestPDF.ConformanceTests.TestEngine;
- [TestFixture]
- [Parallelizable(ParallelScope.All)]
- internal abstract class ConformanceTestBase
- {
- public static readonly IEnumerable<PDFA_Conformance> PDFA_ConformanceLevels = Enum.GetValues<PDFA_Conformance>().Skip(1);
- public static readonly IEnumerable<PDFUA_Conformance> PDFUA_ConformanceLevels = Enum.GetValues<PDFUA_Conformance>().Skip(1);
-
- [Test]
- [Explicit("Manual debugging only (override to enable)")]
- public void GenerateAndShow()
- {
- GetDocumentUnderTest()
- .WithSettings(new DocumentSettings
- {
- PDFA_Conformance = PDFA_Conformance.PDFA_3A
- })
- .GeneratePdfAndShow();
- }
-
- [Test, TestCaseSource(nameof(PDFA_ConformanceLevels))]
- public void Test_PDFA(PDFA_Conformance conformance)
- {
- GetDocumentUnderTest()
- .WithSettings(new DocumentSettings
- {
- PDFA_Conformance = conformance
- })
- .TestConformanceWithVeraPdf();
- }
-
- [Test, TestCaseSource(nameof(PDFUA_ConformanceLevels))]
- public void Test_PDFUA(PDFUA_Conformance conformance)
- {
- GetDocumentUnderTest()
- .WithSettings(new DocumentSettings
- {
- PDFUA_Conformance = conformance
- })
- .TestConformanceWithVeraPdf();
- }
-
- [Test]
- public void TestSemanticMeaning()
- {
- var expectedSemanticTree = GetExpectedSemanticTree();
- GetDocumentUnderTest().TestSemanticTree(expectedSemanticTree);
- }
- protected abstract Document GetDocumentUnderTest();
-
- protected abstract SemanticTreeNode? GetExpectedSemanticTree();
- }
|