Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.Savepoint sp = Database.setSavepoint();
- try {
- //all you anonymous code
- } catch(DmlException e) {
- System.debug('DmlException='+e);
- } finally {
- Database.rollback(sp);
- }
- doStuffHere();
- throw new NullPointerException();
- $ force apex -test
- >> Start typing Apex code; press CTRL-D(for Mac/Linux) / Ctrl-Z (for Windows) when finished
- Test.startTest();
- List<Account> accounts = [SELECT Id FROM Account];
- System.assertEquals(3, accounts.size(), 'number of accounts');
- Test.stopTest();
- >> Executing code...
- ERROR: System.AssertException: Assertion Failed: number of accounts: Expected: 3, Actual: 152
- $ echo $?
- 1
Add Comment
Please, Sign In to add comment