Skip to main content
3 Antworten
  1. 15. März 2020, 13:34

    Here it is

    @isTest

    public class ContactTrigger_Test {

    static testMethod void test_contact_cannot_detele_without_account(){

    Contact contact = new Contact(LastName = 'Test');

    insert contact;

    try {

    delete contact;

    } catch (Exception ex){

    system.assert(ex.getMessage().contains('Cannot delete without AccountId.'));

    }

    }

    }

     
0/9000