Test example 5 – how to parameterize tests
Writing test automation, including design and coding, is a considerable effort, which has a lot of details to pay attention to. However, once you've got the hang of it and have it in place, you will enjoy it and continue to profit from it. This is the case unless you're sloppy on the details at both the design and coding levels, and thus have to keep fixing your tests.
Nevertheless, you will enjoy writing even more if you make your tests generic by parameterizing them. By the nature of the testability framework, you will not be able to parameterize a test function, but you can achieve this by encapsulating your generic test code in a helper function.
Customer wish
Let's illustrate this with another part of our customer's wish: archiving a sales document. As Business Central enables the user to archive a sales quote, a sales order, and a sales return order, we have to include this in our extension. This...