Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Test Apex Triggers from (module - Apex Testing)
- -------------------------------------------------
- Name: TestRestrictContactByName
- SOURCE CODE:
- @isTest
- private class TestRestrictContactByName {
- static testMethod void metodoTest()
- {
- List<Contact> listContact= new List<Contact>();
- Contact c1 = new Contact(FirstName='Francesco', LastName='Riggio' , email='[email protected]');
- Contact c2 = new Contact(FirstName='Francesco1', LastName = 'INVALIDNAME',email='[email protected]');
- listContact.add(c1);
- listContact.add(c2);
- Test.startTest();
- try
- {
- insert listContact;
- }
- catch(Exception ee)
- {
- }
- Test.stopTest();
- } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement