Skip to content

Instantly share code, notes, and snippets.

@shinchit
Created September 23, 2019 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinchit/f9dfe47f839505736eebf70dd61a2f91 to your computer and use it in GitHub Desktop.
Save shinchit/f9dfe47f839505736eebf70dd61a2f91 to your computer and use it in GitHub Desktop.
public with sharing class AccountList {
public static List<Account> getAccounts() {
List<Account> accs = [SELECT Id, Name FROM Account];
return accs;
}
}
@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