Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Allow fixtures of parent objects in constructor #6

Open
cropredyHelix opened this issue Oct 8, 2017 · 1 comment
Open

Comments

@cropredyHelix
Copy link

cropredyHelix commented Oct 8, 2017

Currently, you can construct a sfab_FabricatedSObject these ways:

  • new sfab_FabricatedSObject(Type xxx.class);
  • new sfab_FabricatedSObject(Type xxx.class, map<SObjectField,Object> valuesByFieldToken);

It would be useful in constructing fixtures of SObjects to also support:

new sfab_FabricatedSObject(
       Type xxx.class, 
       map<SObjectField,Object> valuesByFieldToken,
       map<String,sFab_FabricatedSObject> fabricatedParentsByRelationshipName);

A common use case is to have a fixture of "default" SObject where such default includes default parents. For example, a default Opportunity with a default Account.

BTW; we've installed this package in our org and love it! Replaces an earlier home grown library that used similar JSON technique but wasn't as expressive.

@mattaddy
Copy link
Owner

mattaddy commented Nov 1, 2017

@cropredyHelix Thanks for the suggestion! I'll take a look more this week.

I'm glad to hear that you've found the package useful!

bobalicious added a commit that referenced this issue Sep 12, 2022
Moved over to SFDX format and upgraded API versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants