web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Unit Testing Private and Protected Methods

(0) ShareShare
ReportReport
Posted on by 175

Does anyone know how to test private methods of a class in AX using the Unit Testing Framework? I really don't want to make all my methods public and I would also like to write tests for all my methods on a class.

Thanks,

Tory

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    Re: Unit Testing Private and Protected Methods

    This is somewhat of a hack and it may stop working in some version of AX at some point, but you can use DictClass to invoke methods, and this effectively ignores the method modifiers.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans