Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to make a Fake object from a Table ?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

  • Martin Dráb Profile Picture
    Martin Dráb 230,253 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,253 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans