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

How to pass parameters to system.currentPagereference.getParameters().get() in Test Methods
Hi
I have written the below code in the controller.
public void init()
{
Bid=System.currentPageReference().getParameters().get('BilltoId');
Rid=System.currentPageReference().getParameters().get('ResellerId');
Coid=System.currentPageReference().getParameters().get('CopyId');
}
While writing test methods i am not able to pass the parameters.Its showing code does'nt have test coverage
Any help will be appreciated.
Thanks in advance.
In testing, you want to build all new records (which are automatically deleted after the test is executed)
So, following your example, create the billTo account record, which creates its id.
Account billTo = new Account(
name = 'BillTo');
insert billTo;
Then you create the controller and visual page in test