How to Create a unit test for a simple Apex class

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

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

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.

Solved Programs