bcquality/microsoft/knowledge/testing/given-blocks-must-cover-full-precondition-chain.good.al
Michael Dieringer a4d85c3e9e Add 18 more community AL/BC patterns across appsource, data-modeling, error-handling, security, style, testing, ui, upgrade, and web-services
Second contribution from CURABIS ApS, generalized from patterns observed across real AppSource/PTE development. Cross-checked against the current microsoft/knowledge corpus before opening; several originally-drafted candidates were dropped as duplicates of existing files.
2026-09-21 22:42:49 +02:00

15 lines
554 B
Perl

[Test]
procedure PostSalesOrder_CreatesInvoice()
var
Customer: Record Customer;
SalesHeader: Record "Sales Header";
begin
// [GIVEN] a customer with a full posting-group chain and VAT setup
LibrarySales.CreateCustomerWithPostingSetup(Customer);
// [GIVEN] a sales order for that customer, dated explicitly
LibrarySales.CreateSalesOrderForCustomer(SalesHeader, Customer."No.", WorkDate());
// [WHEN]
LibrarySales.PostSalesOrder(SalesHeader, false, true);
// [THEN]
Assert.RecordIsNotEmpty(SalesInvoiceHeader);
end;