Test example 13 – VAT Registration No. validation
In this example, we are going to show how the standard VAT registration number validation feature in Business Central could be made testable, enabling us to mimic the validation service. For your convenience, we have duplicated Figure 13.2 here, showing you the basic flow of the VAT registration number validation:
As we are not able to modify the code behind this standard feature, and as the code does not provide the right means to hook into it, we will build a standalone feature that imitates the process, as discussed in Replacing a server with a test double – dependency injection section. This standalone feature allows us to demonstrate how DI could help make an outgoing call testable.
Note
As in the previous example, we will again focus on the structure and code of the automated tests and not on the flow...