Article
· Sep 19, 2017 1m read

UnitTest : A Mocking Framework for InterSystems objectscript classes.

It is with great pleasure that the CIUSSS de l'Estrie - CHUS is sharing the mocking framework it developed and presented at the InterSystems Summit 2017.  I will update this post with more detailed instructions in the next few weeks but I wanted to share the code and presentation quickly : 

https://gitlab.com/ciussse-drit-srd-public/Mocking-Framework

I hope you'll find this useful for your unit testing. We are using this extensively for the last 2 years and it really works well! The repo is public, feel free to submit enhancements!

Do not forget to enable the %UnitTest in your SMP. Instructions are online at http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

Kind regards

André-Claude Gendron

Discussion (14)6
Log in or sign up to continue

Hi Andre Claude,

Thank you for sharing your framework, and for great presentation at Global Summit. I'm looking forward to see your detailed article in Developers Community!

We have a documentation available online, you can link directly to it: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=TUNT_ExampleTestPortal

Also, video recording of Andre's presentation and PDF of his slides are available at https://learning.intersystems.com/course/view.php?id=664

Hi Andre-Claude,

Thank you for the contribution! We've begun to fold the use of this Mock framework into our daily activities.

I know this post is rather old, but I do have a question. Some of the classes in the repository use classes that are not present in the repo any where (Tests.Fw.Mock.CIsEqualObjectParamValidator for example). If you are willing, would you be able to commit those to the GitLab site?

Again, thank you for sharing this with the rest of us.

Hi,

I know it is a old thread but I thought I'd ask if there are any updates to this framework? The repo is 4 years old and I'm looking for a solution for a mocking framework atm. I noticed also that some classes are missing like Jonathan Lent stated. Is there any possibility for you to update the repo with the latest changes if there are any? I'm working on unit tests and trying to find out a way to mock different business hosts and I found this framework to be a promising one.

Cheers,
Kari

I just remembered, I fixed this but was waiting for a review. I merged it this morning.

https://github.com/GendronAC/InterSystems-UnitTest-Mocking/pull/3

(code was sent to github per InterSystems request)

Latest code is here : 
https://github.com/GendronAC/InterSystems-UnitTest-Mocking

Let me know if you need something else. Have a look at the CTestCustomPassthroughOperation.cls class