You can do some state testing of immediate custom actions using Lux. If you concentrate on having most of the logic in the immediate custom action, then unit testing of the deferred custom actions can proceed much like ordinary C++ or C# code. Lux mutation can be used to explore immediate custom action behavior in different install and/or machine states.
I would mock (an interesting idea) only for deferred actions. Then you can focus on just their function. Except for the mocking (which I'll have to explore--currently use stubs), this is the scheme I use for all of my custom actions. I have immediate actions set properties, and then a table drives the deferred and commit custom actions from a table-driven immediate custom action. Deferred and commit actions then alter machine state. Rollback is scheduled as part of the table-driven immediate custom action. -- John Merryweather Cooper Senior Software Engineer | Integration Development Group | Enterprise Notification Service Jack Henry & Associates, Inc.® | Lenexa, KS 66214 | Ext: 431050 |jocoo...@jackhenry.com -----Original Message----- From: Griesshammer, Christoph (GE Healthcare) [mailto:christoph.griessham...@ge.com] Sent: Thursday, May 28, 2015 4:06 PM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Testing C# Custom Actions The e-mail below is from an external source. Please do not open attachments or click links from an unknown or suspicious origin. I've looked high and low, and there's not much discussions about unit testing custom actions. Does anybody have a strategy for this? My initial thought was to refactor my code so that any Session references occur outside of the scope of what I'm testing, but that no longer works for some of my custom actions. Now I'm at the point where I need to mock the Session class, but it's proving to be a very difficult task. Thank you, Christoph Griesshammer GE Healthcare IT Software Engineer E: christoph.griessham...@ge.com<mailto:christoph.griessham...@ge.com> http://www.gehealthcare.com<http://www.gehealthcare.com/> 116 Huntington Ave Boston, MA, USA 02116-5744 GE Imagination at Work ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users