3 Antworten
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.'));
}
}
}