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
srikanth11srikanth11 

help for test case

this is the controller i have written and plz help me how to write test case

Public class Remarkscontroller {
public Appointment__c[] blockedappts {get; set;}
String m_param;
String y_param;
Date Di = system.today();
Public Integer monthc {get;set;}
public  Integer Year{get; set;} 
Public string monthname {get;set;}
  

public Remarkscontroller(Dev_Appt_Calendar_Repeat controller) {
m_param = System.currentPageReference().getParameters().get('br');
y_param = System.currentPageReference().getParameters().get('dr');

Monthc = di.month();
Year= di.year();
if(Monthc == 12){
monthname = 'December';
}
if(Monthc == 11){
monthname = 'November';
}
if(Monthc == 10){
monthname = 'October';
}
if(Monthc == 9){
monthname = 'September';
}
if(Monthc == 8){
monthname = 'August';
}
if(Monthc == 7){
monthname = 'July';
}
if(Monthc == 6){
monthname = 'June';
}
if(Monthc == 5){
monthname = 'May';
}
if(Monthc == 4){
monthname = 'April';
}
if(Monthc == 3){
monthname = 'March';
}
if(Monthc == 2){
monthname = 'Febuary';
}
if(Monthc == 1){
monthname = 'January';
}

//blockedappts = [select id,appt_date__c,Calander_Day__c,Appt_remarks__c,Block_the_Entire_Day__c  from Appointment__c where Block_the_Entire_Day__c=TRUE AND Recordtypeid=:'01290000000YnZw' AND CALENDAR_YEAR(Appt_date__c) =:Year AND CALENDAR_MONTH(Appt_date__c)=:month AND branch__c =: m_param AND Doctor__c=:y_param];
blockedappts = [select id,appt_date__c,Calander_Day__c,Appt_remarks__c,Block_the_Entire_Day__c  from Appointment__c where Block_the_Entire_Day__c=TRUE AND Recordtypeid=:'01290000000YnZw' AND CALENDAR_YEAR(Appt_date__c) =:Year AND CALENDAR_MONTH(Appt_date__c)=:Monthc AND branch__c =: m_param AND Doctor__c=:y_param];



}






}
this is the test case i havew written and the error is saying the constructor is not defined

@isTest
private class Remarkscontroller_TC
{
static testmethod void TestController()
{

Remarkscontroller rc= new Remarkscontroller();

}
}

 

kiranmutturukiranmutturu

u are defined a parameterized constructor there and in test class u are calling as non parametrized one....pass the parameter in to that ...

srikanth11srikanth11

can u tell me how to paraameterize it by changing my code