Skip to content

Instantly share code, notes, and snippets.

@rsoesemann
Last active January 24, 2019 14:52
Show Gist options
  • Save rsoesemann/88b7b07f539f5d8b8e2364afa1a8ba80 to your computer and use it in GitHub Desktop.
Save rsoesemann/88b7b07f539f5d8b8e2364afa1a8ba80 to your computer and use it in GitHub Desktop.
Apex DomainBuilder
@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