MFCORE_TestFactory Class

Test Factory for creating test data

Namespace

mfwe

Fields

ACCOUNT_NAMES

Signature

global static final ACCOUNT_NAMES

Type

List<String>


ADDRESSES

Signature

global static final ADDRESSES

Type

List<String>

Methods

createAccounts(count)

Create a list of test parent accounts each having a separate child account

Signature

global static List<Account> createAccounts(Integer count)

Parameters

NameTypeDescription
countIntegerThe number of parent and child accounts to create. 1-to-1 relationship.

Return Type

List<Account>

List of child accounts created

Example

List<Account> accounts = mfwe.MFCORE_TestFactory.createAccounts(5);

createParentAccounts(count)

Create a list of test parent accounts

Signature

global static List<Account> createParentAccounts(Integer count)

Parameters

NameTypeDescription
countIntegerThe number of parent accounts to create

Return Type

List<Account>

List of parent accounts created

Example

List<Account> accounts = mfwe.MFCORE_TestFactory.createParentAccounts(5);

createContacts(count, accounts)

Create a list of test contacts

Signature

global static List<Contact> createContacts(Integer count, List<Account> accounts)

Parameters

NameTypeDescription
countIntegerThe number of contacts to create
accountsList<Account>The list of accounts to associate the contacts with

Return Type

List<Contact>

List of contacts created


createCase(count)

Creates records of Case object.

Signature

global static List<Case> createCase(Integer count)

Parameters

NameTypeDescription
countIntegerThe number of records to create

Return Type

List<Case>

The list of all created Case records


createDefaultExternalDataService()

Prepares a list of ExternalDataService__c records for testing. Only the default service is created.

Signature

global static List<ExternalDataService__c> createDefaultExternalDataService()

Return Type

List<ExternalDataService__c>

List of ExternalDataService__c records


createExt1ExternalDataService()

Prepares a list of ExternalDataService__c records for testing. Only the external service is created.

Signature

global static List<ExternalDataService__c> createExt1ExternalDataService()

Return Type

List<ExternalDataService__c>

List of ExternalDataService__c records


createVoidApexExternalDataService()

Prepares a list of ExternalDataService__c records for testing. Only the void apex service is created.

Signature

global static List<ExternalDataService__c> createVoidApexExternalDataService()

Return Type

List<ExternalDataService__c>

List of ExternalDataService__c records


createVoidExternalDataService()

Prepares a list of ExternalDataService__c records for testing. Only the void service is created.

Signature

global static List<ExternalDataService__c> createVoidExternalDataService()

Return Type

List<ExternalDataService__c>

List of ExternalDataService__c records


createIdentifyingFields()

Prepares a list of IdentifyingField__c records for testing. basic setup with account, case and contact sobjects

Signature

global static List<IdentifyingField__c> createIdentifyingFields()

Return Type

List<IdentifyingField__c>

List of IdentifyingField__c records


createTemplateSObjectMappings()

Prepares a list of TemplateSObjectMap__c records for testing. Basic setup with account, related contact and owner (User)

Signature

global static List<TemplateSObjectMap__c> createTemplateSObjectMappings()

Return Type

List<TemplateSObjectMap__c>

List of TemplateSObjectMap__c records


setCreateTaskFlag(name, createTask)

Set the create task flag for the specified identifying field record

Signature

global static void setCreateTaskFlag(String name, Boolean createTask)

Parameters

NameTypeDescription
nameStringThe name of the identifying field record
createTaskBooleanThe value to set the create task flag to TRUE or FALSE

Return Type

void


createCustomerEnvironments()

Create a list of a single MetaforceCustomerEnvironment__c record for testing. Only the selected environment is created.

Signature

global static List<MetaforceCustomerEnvironment__c> createCustomerEnvironments()

Return Type

List<MetaforceCustomerEnvironment__c>

List of MetaforceCustomerEnvironment__c records


createUiConfig()

Create a list of a single MetaforceUIConfig__c record for testing. Only the view settings are created.

Signature

global static MetaforceUIConfig__c createUiConfig()

Return Type

MetaforceUIConfig__c

List of MetaforceUIConfig__c records


createClassification(name)

Create a list of a single MetaforceClassification__c record for testing.

Signature

global static List<MetaforceClassification__c> createClassification(String name)

Parameters

NameTypeDescription
nameStringThe name of the classification

Return Type

List<MetaforceClassification__c>

List of MetaforceClassification__c records


createErrorConfig()

Create a list of a single MetaforceErrorConfig__c record for testing. Only the error logging settings are created.

Signature

global static List<MetaforceErrorConfig__c> createErrorConfig()

Return Type

List<MetaforceErrorConfig__c>

List of MetaforceErrorConfig__c records