When you are creating your test functions, it's best practice to use the Given-When-Then format:
- Given: This is a step that sets up the test. You can have multiple of these.
- When: This is a step that describes what is being tested. You should only have one of these.
- Then: This is the result being verified by the test. You can have multiple of these.
Here's an example:
- Given: This is the Sales Order document page.
- When: A user with no approval authority releases the order.
- Then: An error is presented to the user, asking them to submit the order for approval.
Check out Microsoft Docs for more information on this: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-extension-advanced-example-test#describing-your-tests.