+ Start a Discussion
NNRNNR 

test class code coverage wrapper

<!--  public List<insClaimWra> getinsClaiDowload(){
     
           LIST<INSCLAIMWRA> INSROWS=NEW LIST<INSCLAIMWRA>();
           
           FOR(SOBJECT R : SETCON.GETRECORDS()){
               INSURANCE_CLAIM__C CLAIM=(INSURANCE_CLAIM__C)R;
               INSCLAIMWRA ROW = NEW INSCLAIMWRA(CLAIM,TRUE);
              IF(THIS.SELECTEDINSCLAIMIDS.CONTAINS(CLAIM.ID)){
                ROW.ISSELECTED=TRUE;
            }
            ELSE{
                ROW.ISSELECTED=FALSE;
            }
              INSROWS.ADD(ROW);
           }    
     
       return insRows;
    }
    // commonad button method
    Public PageReference downloadInsClaims(){
        selectedInsClaims= new List<Insurance_Claim__c>();
        UpdateList= new List<Insurance_Claim__c>();
        for(Insurance_Claim__c insclaims:[select id,name,Rejected_Reason__c,Client_Urn__c,ClaimSubmittedToInsDate__c ,RecordTypeId,Rejected_Date__c,Status__c from Insurance_Claim__c where id in:selectedInsClaimIds]){
           SELECTEDINSCLAIMS.ADD(INSCLAIMS);
           INSURANCE_CLAIM__C INS=NEW INSURANCE_CLAIM__C(ID=INSCLAIMS.ID);
           INS.CLAIMSUBMITTEDTOINSDATE__C=SYSTEM.TODAY();
           UPDATELIST.ADD(INS);
        }
        try{
        Database.update(UpdateList);
        //selectedInsClaims.addAll(UpdateList); //after  updated Recordslist
        }
        catch(DMLException e){
        }
        PageReference secondPage = new PageReference('/apex/insuranceClaimdownloadpage');
        secondPage.setRedirect(false);
        system.debug('selectedInsClaims################'+selectedInsClaims);
        return secondPage;
       

    }

upper case lines not get code coverage how to get code coverage for upper letters lines
 PageReference pageRef = Page.insuranceClaimdownload;
              Test.setCurrentPage(pageRef);
              insuranceClaimdownload ext = new insuranceClaimdownload();
              Insurance_Claim__c ins=new Insurance_Claim__c();
              Boolean flag;
              insuranceClaimdownload.insClaimWra cm=new insuranceClaimdownload.insClaimWra(ins,flag);
             // List<insuranceClaimdownload.insClaimWra> wrp = ext.getinsClaiDowload();
              //wrp.Isselected=true;
              ext.getHasNext();
               ext.getHasPrevious();
               ext.doPrevious();
               ext.setCon.next();
               ext.setCon.previous();
               ext.doSelectItem();
               ext.doDeselectItem();
               ext.getinsClaiDowload();
             
              for(insuranceClaimdownload.insClaimWra wrp:ext.getinsClaiDowload()){
                wrp.Isselected=true;
              }
             
             ext.doNext();
              
             ext.downloadInsClaims();
             inscl.ClaimSubmittedToInsDate__c=system.today();         
             inscl.status__c='Claim Submitted to Ins';
             inscl.RecordTypeId=ClaimSubmittedToIns;
              inscl.Upload_Date__c=system.today();
             update inscl;
              ext.getdownLoadRecordlist();
Martijn SchwarzerMartijn Schwarzer
Hi NNR,

I'm not really sure what's going on here, since you've only posted parts of your code. A few things come to mind:

1: Do you create test data in your test method? That would explain the blocks of code after the SOQL statement not being executed.
2: What happens when you call the constructor of insuranceClaimdownload.insClaimWra? Can you call that constructor with the 2nd parameter being null? (You only define the Boolean flag, but you don't assign a value to it)

Can you please post your full classes and pages involved? It makes the investigation much easier.

Best regards,
Martijn Schwärzer