System.assertEquals()
Public class AssertDemo { public void NewContact(String LastNameStr, String EmailStr) { Contact ConInstance = new Contact(LastName = LastnameStr,Email = EmailStr); Insert ConInstance; System.assertEquals('SFDCDOTCOM',ConInstance.LastName); } } //the lastname of the Contact should be 'SFDCDOTCOM'. If we give the lastname
// other than 'SFDCDOTCOM', it will throw error.
No comments:
Post a Comment