Skip to content

Commit

Permalink
Add unit test for EAS
Browse files Browse the repository at this point in the history
  • Loading branch information
midran committed Oct 25, 2024
1 parent 8466d0c commit cd38437
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rules/buildconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,14 @@
<file path="sch/PEPPOL-EN16931-sb-UBL.sch" infoUrl="http://docs.peppol.eu/poacc/billing/3.0/rules/{}/"/>
</configuration>

<!--
<configuration>
<identifier>peppolbis-en16931-sb-3.0-ubl-invoice</identifier>
<identifier>peppolbis-en16931-3.0-ubl-sbinvoice</identifier>
<title>PEPPOL BIS Self-Billing 3.0 (Profile)</title>
<declaration type="xml.ubl">Invoice::urn:fdc:peppol.eu:2017:poacc:selfbilling:01:1.0#urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:selfbilling:3.0</declaration>
<inherit>ubl-invoice-2.1</inherit>
<inherit>peppolbis-en16931-cen-ubl</inherit>
<inherit>peppolbis-en16931-base-3.0-ubl</inherit>
<inherit>peppolbis-en16931-sbbase-3.0-ubl</inherit>
<inherit>peppolbis-en16931-stylesheet-3.0-ubl</inherit>
</configuration> -->
</configuration>

</buildConfigurations>
36 changes: 36 additions & 0 deletions rules/unit-UBL-PEPPOL-SB/PEPPOL-COMMON-EAS.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<testSet xmlns="http://difi.no/xsd/vefa/validator/1.0" configuration="peppolbis-en16931-01-3.0-ubl-sbinvoice">
<assert>
<scope>PEPPOL-EN16931-CL008</scope>
</assert>
<test>
<assert>
<description>Check that code 0208, part of EAS and PEPPOL succeeds validation</description>
<success>PEPPOL-EN16931-CL008</success>
</assert>
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="0208">1234567890</cbc:EndpointID>
</cac:Party>
</cac:AccountingCustomerParty>
</Invoice>
</test>
<test>
<assert>
<description>Check that code 0207, part of EAS and not part of PEPPOL fails validation</description>
<error>PEPPOL-EN16931-CL008</error>
</assert>
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<cac:AccountingSellerParty>
<cac:Party>
<cbc:EndpointID schemeID="0207">1234567890</cbc:EndpointID>
</cac:Party>
</cac:AccountingSellerParty>
</Invoice>
</test>
</testSet>

0 comments on commit cd38437

Please sign in to comment.