Created
September 23, 2019 23:09
-
-
Save shinchit/f9dfe47f839505736eebf70dd61a2f91 to your computer and use it in GitHub Desktop.
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
public with sharing class AccountList { | |
public static List<Account> getAccounts() { | |
List<Account> accs = [SELECT Id, Name FROM Account]; | |
return accs; | |
} | |
} |
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 | |
public with sharing class AccountList_Test { | |
@isTest static void testGetAccounts() { | |
Test.startTest(); | |
List<Account> accs = AccountList.getAccounts(); | |
System.assertNotEquals(accs, null, 'getAccounts returns null'); | |
Test.stopTest(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment