How to write a test class for a controller which gets id from the url?

Sample Code:

Account acct = new Account(Name = 'Test');
insert acct;

apexpages.currentpage().getparameters().put('Aid' , acct.Id);
Class_Name controller = new Class_Name() ;

Cheers!!!

No comments:

Post a Comment