Skip to content

Commit

Permalink
Update TDF.cls
Browse files Browse the repository at this point in the history
  • Loading branch information
benahm committed Apr 13, 2018
1 parent 4073f59 commit af10f51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/TDF.cls
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* @date 2017
* @description Apex Test Data Factory
*/
@isTest
public class TDF {

@TestVisible
// Org config
// ==========================================================================
private static final Boolean PERSON_ACCOUNT_IS_ENABLED = false;
Expand Down Expand Up @@ -47,6 +46,7 @@ public class TDF {
}
}


/**
* @description create an sObject
* @param sObjectName (String): name of the sObject to be created
Expand Down Expand Up @@ -679,7 +679,7 @@ public class TDF {
if(overrideFieldValue instanceof AutoFieldDefaultValue) { // auto generate a field value
if(fieldDesc.getRelationshipName() == null){ // field
// put a fieldDefaultValue instance of the field in order to auto-generate the field default value
mapOfValues.put(fullyQualifiedFieldName,new FieldDefaultValue(defaultValueProvider,sObjectDesc,fieldDesc));
mapOfValues.put(fullyQualifiedFieldName,new FieldDefaultValue(this,sObjectDesc,fieldDesc));
}else { // relationship
// put a field relationship in the map of values
putRelationshipField(mapOfValues,fieldDesc,prefix); // <== recursion
Expand All @@ -693,7 +693,7 @@ public class TDF {
if(fieldDesc.getRelationshipName() == null){ // field
if(isRequired){
// put a fieldDefaultValue instance of the field in order to auto-generate the field default value
mapOfValues.put(fullyQualifiedFieldName,new FieldDefaultValue(defaultValueProvider,sObjectDesc,fieldDesc));
mapOfValues.put(fullyQualifiedFieldName,new FieldDefaultValue(this,sObjectDesc,fieldDesc));
}
}else { // relationship
String relationshipName = fieldDesc.getRelationshipName().toLowerCase();
Expand Down

0 comments on commit af10f51

Please sign in to comment.