AL icon indicating copy to clipboard operation
AL copied to clipboard

Can not call local Procedures in test codeunit

Open KoFrank opened this issue 7 years ago • 2 comments

It is not possible to call main extension procedures marked local from a test Codeunit. We don't want to make the procedures of the extension public, as they will not be useful for any external application. Do we have to make them public to run through them from a test code coverage point of view?

Is the preffered way to have the local functions be called via the public procedures actually using them in a test codeunit?

Versions:

  • AL Langauge: 2.0.43900

KoFrank avatar Jan 15 '19 09:01 KoFrank

@KoFrank if the function is not part of your public interface, you should keep it local and test it by calling methods that are part of your public interface. You do not have to call the method directly for it to be included in the code coverage analysis. I suggest you post this question to one of the following resources to get more opinions on the matter: Business Central Community mibuso forum Dynamics User Group

atoader avatar Jan 15 '19 10:01 atoader

@KoFrank I will close this issue now since @atoader answered your question. Thanks!

ghost avatar Jan 21 '19 11:01 ghost