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
Santhosh Gaddam 3Santhosh Gaddam 3 

how to write testclass for my controller

public class Document_TriggerHandler{
    // Getting the Document Id and creating a Document Url.
    public static string getStrLogoUrl(){
        list<Document> lstDocument = [SELECT Id,Name,DeveloperName FROM Document WHERE DeveloperName=:Label.my_Label2];
        String strOrgId = UserInfo.getOrganizationId();
         string strLogoUrl = System.URL.getSalesforceBaseUrl().toExternalForm() + 
            '/servlet/servlet.ImageServer?id='+lstDocument[0].Id +
            '&amp;oid=' + strOrgId;
        system.debug('===>'+strLogoUrl);
        return strLogoUrl;
    }
    public static string getLogoUrl(){
        list<Document> documentLst = [SELECT Id,Name,DeveloperName FROM Document WHERE DeveloperName=:Label.My_Label1];
        String orgId = UserInfo.getOrganizationId();
            String logoUrl = System.URL.getSalesforceBaseUrl().toExternalForm() + 
            '/servlet/servlet.ImageServer?id='+documentLst[0].Id +
            '&amp;oid=' + orgId;
        return logoUrl;
    }
    
    public String getLoginUrl(){
        List<Network> netList= [SELECT Id,Name FROM Network where Name=:Label.MY_Label];
        return Network.getLoginUrl(netList[0].Id);
        
    }
}
ANUTEJANUTEJ (Salesforce Developers) 
Hi Santosh,

>> https://salesforce.stackexchange.com/questions/230205/test-class-for-a-custom-controller

The above link has an explanation to write a test class to a custom controller, you can try checking for implementing your use case.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.