Skip to content

Instantly share code, notes, and snippets.

@jaspreetsidhu
Created September 15, 2019 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaspreetsidhu/88fee6362d833ea04fff72c0313e2b5c to your computer and use it in GitHub Desktop.
Save jaspreetsidhu/88fee6362d833ea04fff72c0313e2b5c to your computer and use it in GitHub Desktop.
@isTest
public class TestRestrictContactByName {
@isTest static void testContactTrigger() {
Test.StartTest();
Contact c = new Contact(LastName = 'INVALIDNAME');
Database.SaveResult result = Database.insert(c, false);
System.assert(!result.isSuccess());
System.assert(result.getErrors().size() > 0);
Test.StopTest();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment