Skip to content

Instantly share code, notes, and snippets.

@rsoesemann
Created February 9, 2018 08:53
Show Gist options
  • Save rsoesemann/fef3849265e033d34814edf941f0eaa1 to your computer and use it in GitHub Desktop.
Save rsoesemann/fef3849265e033d34814edf941f0eaa1 to your computer and use it in GitHub Desktop.
How Custom Metadata should be usable in Apex
@IsTest
private class CustomMetadataInApex_Test {
@IsTest
private static void workLikeCustomObject() {
insert new ProductSetting__mdt(RelatedSObjectType__c = 'Account', DeveloperName = 'EnableFeature');
System.assertEquals(1, [SELECT COUNT() FROM ProductSetting__mdt]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment