Skip to content

Instantly share code, notes, and snippets.

@gitmatheus
Last active March 25, 2022 00:45
Show Gist options
  • Save gitmatheus/d76a07c988610de09e2775eac3c8cb80 to your computer and use it in GitHub Desktop.
Save gitmatheus/d76a07c988610de09e2775eac3c8cb80 to your computer and use it in GitHub Desktop.
// Snippet from AccountTriggerHandlerTest
...
mockDataLayer = new MockDataLayer();
mockFieldReader = new MockFieldReader();
...
// First, the formula field on the child object:
mockFieldReader.addValueToField(
mockDataLayer.childAccount,
'External_URL__c',
expectedURL
);
// Then, the nonwritable child relationship
mockFieldReader.addValueToField(
mockDataLayer.parentAccount,
'Child_Accounts__r',
new List<Account>{mockDataLayer.childAccount}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment