+ Start a Discussion
Salesforce2015Salesforce2015 

Test Class for existing Apex Class

Hi Experts,

below is my Apex Class, i need test class for my below class.


public class SendPartnerGroupRequirementsExt {
    public String RequirementID{get;set;}
    public SendPartnerGroupRequirementsExt(ApexPages.StandardController controller) {

    }    
    public PageReference SendRequest(){
        RequirementID=ApexPages.currentPage().getParameters().get('id');
        list<Partner_Group_Requirement__c> PartgroupRequrement=[select id,Name,Partner_Group__c,Request_Type__c,Document_Type__c,Due_Date__c from Partner_Group_Requirement__c where id=:RequirementID];
        list<Request__c> ReqList=new list<Request__c>();
       for(Partner_Group_Requirement__c PGR : PartgroupRequrement){
            Request__c Req=new Request__c();
            //Req.Partner_Group__c=PGR.Partner_Group__c;
            Req.Request_Type__c=PGR.Request_Type__c;
            Req.Container_Template__c=PGR.Document_Type__c;
            Req.Due_Date__c =PGR.Due_Date__c;
            ReqList.add(Req);
            
        }
        
        if(ReqList.size()>0){
          system.debug('&&&&&sample&&&&&'+ReqList);
           insert ReqList;
           for(Request__c Req : ReqList){
               Recipient__c Recp=new Recipient__c();
               //Recp.Partner_Group__c=Req.Partner_Group__c;
               Recp.Request__c=Req.id;
               insert Recp;
               system.debug('******sampletest******'+Recp);
           } 
        }
        PageReference orderPage = new PageReference('/'+RequirementID);
        orderPage.setRedirect(true);
        return orderPage;
    }
 
}


Thanks in advance.

Thanks,
Manu
AshlekhAshlekh
Hi,

What you have writter so far in test class for this code. could you please post that.

-Thanks
Ashlekh Gera
Salesforce2015Salesforce2015
Hi Ashlekh,

Thanks for quick response.

I need test class for above apex class. no need to change apex class.