Extending Microsoft Dynamics 365 Finance and Supply Chain Management Cookbook - Second Edition
by Simon Buxton
How it works...
The new concept here was the new ensure method. This is a simple example of making the data-generation side of testing as simple as possible. If we wanted to post a sales invoice, we would simply write ensureCanPostSalesInvoice. This would create the necessary data. The method can chain other ensure methods so that each ensure method remains as small as possible.
In our case, to create a vehicle, we had to just ensure that a vehicle group was created. That, in turn, created a parameter with a default vehicle group.
When we created the default, you may have noticed that we specified the instanceRelationType field. This is only required for tables that take part in inheritance and is the table ID of the table we are working ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access