+ Start a Discussion
pranav shah 40pranav shah 40 

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.