You need to sign in to do that
Don't have an account?
Feel Free To Ask
I have created an Apex class but don't know how to write its test class. Can anyone help me in writing its test class. Please.
public class printpdf {
public List<QuoteLineItem> prd{get;set;}
private final ApexPages.StandardController theController;
public printpdf(ApexPages.StandardController controller) {
theController = controller;
prd = [Select Id , QuoteId, Product2Id, Product2.Name, Product2.Description, Product2.ProductCode, Product2.Cross_Distr_Channel_Status__c, Product2.GB_Enterprise_Prod_Hier_Level_5__c from QuoteLineItem where QuoteId=:thecontroller.getId()];
}
}
public List<QuoteLineItem> prd{get;set;}
private final ApexPages.StandardController theController;
public printpdf(ApexPages.StandardController controller) {
theController = controller;
prd = [Select Id , QuoteId, Product2Id, Product2.Name, Product2.Description, Product2.ProductCode, Product2.Cross_Distr_Channel_Status__c, Product2.GB_Enterprise_Prod_Hier_Level_5__c from QuoteLineItem where QuoteId=:thecontroller.getId()];
}
}
Try with below code. Modify the data as per your need.
If this helps, please mark it as best answer.
Thanks!!