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
ANITHA BEEMUANITHA BEEMU 

can anyone help for test class:

Hi can any one help for writing a test class for ths:

public class LoanDocumentGenrate{

    private final LLC_BI__Loan__c ln;    
   

    public LoanDocumentGenrate(ApexPages.StandardController stdController) {
        
                this.ln = (LLC_BI__Loan__c)stdController.getRecord(); 

    }

    public PageReference pgclose() {
            
        PageReference pgref = new PageReference('/' + ln.Id);
        pgref.setRedirect(true);
        return pgref;  
    }


}
Best Answer chosen by ANITHA BEEMU
Foram Rana RForam Rana R
Hi ANITHA BEEMU,

Hope you are doing great.
Please go through below code.
 
@isTest
public class LoanDocumentGenrate_Test {
    
    @isTest
    public static void testmethod1() {
        
        LLC_BI_Loan__c obj = new LLC_BI_Loan__c();
        insert obj;
        
        ApexPages.StandardController sc = new ApexPages.StandardController(obj);
        LoanDocumentGenrate obj1 = new LoanDocumentGenrate(sc);
        obj1.pgclose();
    }
}

Thanks,
Foram Rana