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
rajubalajirajubalaji 

how to write a test class for below code?

Hi everyone,

Anyone know how to write a test class for elow code please help me.

    public Data Data{get;set;}
    public TrackerData TrackerData{get;set;}
    public DTO Info{get;set;}
    public InfoDTO Info{get;set;}

Thanks
RajuBalaji
AnudeepAnudeep (Salesforce Developers) 
@isTest
private class TestVisibleExampleTest {
    @isTest static void test1() {

        TestVisible t = new TestVisible();
        t.Data = system.today();
        //populate other fields here
    }
}



You test these simply by accessing the variable or by assigning a value to it.

See this post for sample code

Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!