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

Please help me to write test classs for the following controller.


I tried  but its not working

//Controller class for LoginPagePartners(custom login page) for Partner users
global class CustomLogin{
   //Declare Email and password fileds
    global String Email{get; set;}
    global String pwd {get; set;}c
    //getting Email and Password values  
     global void getEmail(){
     global void getpwd(){
     //Actual Login button functionality
     global PageReference login(){ 
     //setting redirect URL     
     String startUrl = '/partners';
     //Using Site.login(string,string,string) standard functionality 
     PageReference ref = Site.login(Email, pwd, startUrl);
     return ref;
Best Answer chosen by sabeera
Harish RamachandruniHarish Ramachandruni

Hi ,

I am writen in org it's getting 100% check it any issue let me know  . 

User-added image

Public  class harishraoTeat{
   Public  static testMethod void harish1() {
   string emailid = '';
  string  posswd = '9676930011';
apexpages.currentpage().getparameters().put('Email' , emailid );

apexpages.currentpage().getparameters().put('pwd' , posswd );

apexpages.currentpage().getparameters().put('Email' , emailid );

 CustomLogin login = new CustomLogin();



If it is usefull make it best answer .