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)

How to make a Fake object from a Table ?

(0) ShareShare
ReportReport
Posted on by

Hi,

Our company is focussed on implementing high quality software so we write a lot of unittests.

Recentely we migrated to MS dynamics 2012 version and started to develop in X++, so we have to setup a framework for mocking.

Till now we were doing great on unittest for classes.

Atm im stuck at a test that uses the IsNewRecord from a Table Object and i need a mock or fake object from the tabel to adjust the result from IsNewRecord().

It seems making a class en extend from the Table is no option.

anyone any idea how to solve this ?

Greetz,

Kurt

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    235,796 Most Valuable Professional on at
    RE: How to make a Fake object from a Table ?

    That's a good question and I gave it some thought when I worked with AX 2012. I thought that maybe I could do it at CIL level, where tables are just classes like anywhere else, but I ended up doing such ugly hacks that I decided it's not a good way and gave it up. I'm interested in what others have managed.

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans