To create a unit test for the vehicle service order's form, follow these steps:
- We must start from the main Dynamics 365 for Operations window; otherwise, the generated code may fail.
- Once at the main menu, click on the settings icon (the cog) and choose Task recorder.
- Click on Create recording in the Task recorder sidebar.
- Enter ConWHSServiceOrderTest in the Recording name field, and a description of what we expect to happen. This will become the class name.
- Click on Start.
- Navigate to the form to test, in our case, Vehicle service orders.
- Create a new service order, and add two lines. The sidebar will record each interaction with the form, so it can pay off to rehearse this first to minimize the number of steps it creates. ...