This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the record | |
QuoteFieldHistory__b bo1 = new QuoteFieldHistory__b(); | |
bo1.Field__c = 'Status'; | |
bo1.Date__c = Date.today(); | |
bo1.NewValue__c = 'In Review'; | |
bo1.OldValue__c = 'Draft'; | |
bo1.Quote__c = '0Q03N000000EnQaSAK'; | |
bo1.User__c = '0053N000002EdVOQA0'; | |
// Insert the record |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Account> accList = TestDataFactory.createSObjectList('Account', new Map<String,Object>{ | |
'Description' => 'Account Description' | |
},10); | |
List<Case> caseList = TestDataFactory.createSObjectList('Case', new Map<String,Object>{ | |
'Account' => AccList, | |
'Contact.Account' => AccList | |
},10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Account> accList = TestDataFactory.createSObjectList('Account', new Map<String,Object>{ | |
'Name' => new List<String>{'Google','Amazon','Facebook','Apple','Microsoft'} | |
'Description' => 'Same description' | |
},5); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<User> uList = TestDataFactory.createSObjectList('User', new Map<String,Object>{ | |
'ProfileId' => UserInfo.getProfileId(), | |
'Username' => 'test{!index}@mytestdomain.developer', | |
'CommunityNickname' => 'test{!index}' | |
},10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Contact> conList = TestDataFactory.createSObjectList('Contact',10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User u = (User)TestDataFactory.createSObject('User', new Map<String,Object>{ | |
'ProfileId' => UserInfo.getProfileId() | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact con = (Contact)TestDataFactory.createSObject('Contact', new Map<String,Object>{ | |
'Description' => 'Contact description', | |
'Account' => new Map<String,Object>{ | |
'Name' => 'Account Name', | |
'Description' => 'Account Description' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact con = (Contact)TestDataFactory.createSObject('Contact', new Map<String,Object>{ | |
'AccountId' => TestDataFactory.DEFAULT_VALUE | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact con = (Contact)TestDataFactory.createSObject('Contact', new Map<String,Object>{ | |
'Description' => TestDataFactory.DEFAULT_VALUE, | |
'Account.Phone' => TestDataFactory.DEFAULT_VALUE | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact con = (Contact)TestDataFactory.createSObject('Contact', new Map<String,Object>{ | |
'FirstName' => 'Doe', | |
'LastName' => 'John', | |
'Account.Description' => 'Description of the related account', | |
'Account.Parent.Name' => 'Name of the parent Account' | |
}); |
NewerOlder