+ Start a Discussion

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;}

AnudeepAnudeep (Salesforce Developers) 
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!