You need to sign in to do that
Don't have an account?

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();
}
}
u are defined a parameterized constructor there and in test class u are calling as non parametrized one....pass the parameter in to that ...
can u tell me how to paraameterize it by changing my code