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
pranavshahpranavshah 

apex test class in salesforce

How we can write test class for folowing lines


f(ISstarrating != '' && ISstarrating == 'StarOptions')
                    {
                        component.Apex.selectRadio theselectlist = new Component.Apex.selectradio();
                        //component.Apex.selectlist theselectlist = new Component.Apex.selectlist();
                        theselectlist.expressions.value = '{!lstLeadGenFollowup['+counter+'].VW_Answer1__c}';
                        theselectlist.id = 'Answer_'+counter;
                        theselectlist.styleClass = 'Answer_'+counter;
                        //theselectlist.size = 1;
                        
                       // AddSelectOption(theselectlist, '', '--None--');
                        for(string s : lstStrSelectOpps)
                        {
                            AddSelectRadioOption(theselectlist, s, s);
                        }
                        fieldDiv.styleClass = 'fieldSubDiv star-rating';
                        fieldDiv.childComponents.add(theselectlist);
                    }


Regards
Pranav Shah
Adelchi PelizzoAdelchi Pelizzo
Of course the whole class is needed to understand, however, you should create test data where (ISstarrating == 'StarOptions'), then run test method.