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

Unit test for page reference Method
Hi how do I write a Unit test for the following Method
public String Account{get;set;} public List<Account> AccountId{get;set;} public Account a{get;set;} public PageReference step2() { if (Account != Null ){ sandAccountId = [select Id from Account where Name = : Account]; for (Account a : AccountId){ account.ParentId = a.Id; } } qot = new Quote(); qot.ExpirationDate = date.today() + 30; return Page.newOpptyStep2; }
1. create new class
2. set the needed data (Account, AccountId)
3. execute method
4. check content of PageReference Note: this is just a pseudocode