Closed ghost closed 9 years ago
Great idea, thanks!
Is there any news about that?
Sorry no progress on this.
I'll gladly accept a pull request though.... :+1:
I've a client that is using fflib and we need to support some undelete behavior. Once we have the extension done and tested i'll make the code available.
@Autobat thats awesome, thanks!
Undelete is in and working however I'm not 100% sure on the following. The current test harness uses mocking for the domain layer, is it possible to mock the recycle bin or should i revert to testing with DML?
Not its not, if you want to follow the intent of the MockDatabase support in the Domain class. The intent is to simply access the routing functionality not to mock the event that generates the event. So a new method on MockDatabase say onUndelete(List
Ah thank you for the point in the right direction. I quickly skimmed the test class and did not grasp what it was doing in enough detail.
Will create the test for the undelete path and have it ready for your review
On Tue, Jul 28, 2015 at 5:45 PM, Andrew Fawcett notifications@github.com wrote:
Not its not, if you want to follow the intent of the MockDatabase support in the Domain class. The intent is to simply access the routing functionality not to mock the event that generates the event. So a new method on MockDatabase say onUndelete(List records) would then set the records member (which mocks the new list/map) along with a new isUndeleted member. Then i assume in your changes you've extended the method signature of the private triggerHandler method. If so, update the testTriggerHandler method, to pass the new isUndeleted member. Note that this framework was put in place before ApexMocks existed btw, updating it to use that is outside the scope of this PR in my view.
— Reply to this email directly or view it on GitHub https://github.com/financialforcedev/fflib-apex-common/issues/18#issuecomment-125486108 .
Thanks for the contribution! :+1:
For completeness, it may be possible to cover all verbs so that a consumer may implement:
onAfterUndelete
(there is no before)a.la: https://github.com/financialforcedev/fflib-apex-common/blob/master/fflib/src/classes/fflib_SObjectDomain.cls#L123