function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cloudtripcloudtrip 

.


  

Best Answer chosen by Admin (Salesforce Developers) 
SFineSFine

Basically, within the class, you want to make a test method and have it run through your various methods. You'll want to follow best practices and make sure you don't rely on data in the system and make your own within the test method, make sure you follow through both good runs and bad runs (errors), and do assert equal checks to make sure everything worked out correctly. It would appear something like this:

 

static testMethod void Testing(){
        Account a=new Account();

        a.name='test';

        insert a;

 

        TestClass tc=new TestClass();

 

        tc.testmethod();

       
    }   

 

 

There's obviously more to it, but that should get you on the right track