How to Create a unit test for a simple Apex class

Prem Tiwari - - Salesforce


In this tutorial, I will explain how to create a unit test for a simple Apex class in Salesforce. Follow the below steps to create a simple Test class for Apex Class.

Step 1) In the Developer Console, click File | New | Apex Class, and enter VerifyDate for the class name, and then click OK.
Step 2) Replace the default class body with the following.

Step 3) Press Ctrl+S to save your apex class.
Step 4) Repeat the previous steps to create the TestVerifyDate class. Add the following for this class.

Reference: Click here


Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.