Last active
January 24, 2019 14:52
-
-
Save rsoesemann/88b7b07f539f5d8b8e2364afa1a8ba80 to your computer and use it in GitHub Desktop.
Apex DomainBuilder
This file contains 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
@IsTest | |
private class DomainBuilder_Test { | |
@IsTest | |
private static void easyTestDataCreation() { | |
// Setup | |
Contact_t jack = new Contact_t().first('Ron').last('Harris'); | |
new Account_t() | |
.name('Acme Corp') | |
.add( new Opportunity_t() | |
.amount(1000) | |
.closes(2019, 12) | |
.contact(jack)) | |
.persist(); | |
// Verify | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment