StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
76 stars 31 forks source link

Suggestion: check that MessageHandler and ConfirmHandler method contain code that checks at least the content vor the Msg/Qst parameter #793

Closed lvanvugt closed 2 weeks ago

lvanvugt commented 3 weeks ago

Quite often I find in test codeunit UI Handlers (Message and Confirm) that do not contain any code. IMHO it should always check the Msg/Qst parameter to validate that the right message/confirm was triggered. If not, it would just handle any message popping up in the execution of the test code.

Justification

When the triggered production code has been changed due to a newly added Message of Confirm, or a change in the flow, existing tests should fail telling me that indeed the business logic has changed. As such it will urge me to update my test code.

Curious what you think about this.