mattaddy / SObjectFabricator

An SObject fabrication API to reduce database interactions and dependencies on triggers in Apex unit tests.
Other
89 stars 14 forks source link

Added text about id generator. Removed invalid ids from the examples. #8

Open renatoliveira opened 6 years ago

renatoliveira commented 6 years ago

I've changed the readme text a bit to use valid Ids, and added a section about using an Id generator class instead of hardcoding them. 👍

renatoliveira commented 6 years ago

Just made an addition: now it is possible to set the parent with a DescribeFieldResult. This way is safer to set relationships between custom objects. I've had an issue a couple of hours ago where I had two custom objects related to each other and the framework couldn't set the relationship correctly because of a typo.

Relationship was like 'Parent__r' and I wrote 'parent__r'. With this, there's no way to get a typo, even if someone changes the field on setup (like when correcting the lowercase "P" in this case).