Guest User

Untitled

a guest
Oct 16th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. System.Savepoint sp = Database.setSavepoint();
  2. try {
  3. //all you anonymous code
  4. } catch(DmlException e) {
  5. System.debug('DmlException='+e);
  6. } finally {
  7. Database.rollback(sp);
  8. }
  9.  
  10. doStuffHere();
  11. throw new NullPointerException();
  12.  
  13. $ force apex -test
  14. >> Start typing Apex code; press CTRL-D(for Mac/Linux) / Ctrl-Z (for Windows) when finished
  15. Test.startTest();
  16. List<Account> accounts = [SELECT Id FROM Account];
  17. System.assertEquals(3, accounts.size(), 'number of accounts');
  18. Test.stopTest();
  19.  
  20. >> Executing code...
  21. ERROR: System.AssertException: Assertion Failed: number of accounts: Expected: 3, Actual: 152
  22. $ echo $?
  23. 1
Add Comment
Please, Sign In to add comment