Created
February 11, 2016 07:51
-
-
Save nocrates/5f8748b6ea6cdbba37a6 to your computer and use it in GitHub Desktop.
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
| /* | |
| * RecordTypeAccessor_Test | |
| * | |
| * Test method and example usage of https://gist.github.com/nocrates/07342092bcac673b62e8 | |
| * | |
| * (c) Appirio 2013 | |
| */ | |
| @isTest | |
| public class RecordTypeAccessor_Test { | |
| public static testmethod void testOne() { | |
| RecordType rt = RecordTypeAccessor.getRecordTypeByName('Account','Person Account'); | |
| system.assert(rt.id != null, | |
| 'Expected RecordType to be found for Account.Person Account, instead found null'); | |
| } | |
| public static testmethod void testTwo() { | |
| RecordType rt1 = RecordTypeAccessor.getRecordTypeByName('Account','Person Account'); | |
| RecordType rt2 = RecordTypeAccessor.getRecordTypeByName('Account','Person Account'); | |
| system.assert(rt1.id != null && rt1.id == rt2.id, | |
| 'Expected to retrieve the same id when querying for same record type twice, instead received ' + | |
| rt1.id + ' and ' + rt2.id); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment