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

Need help with test code for VF controller extension
public with sharing class whitespace{
public String AccountID{get;set;}
public String PAccountID{get;set;}
public List<Account> IPlist{get;set;}
public whitespace(ApexPages.StandardController controller){
AccountID = ApexPages.currentPage().getParameters().get('id');
PAccountID = [select ParentId from Account where ID = :AccountID].ParentId;
if (PAccountID == null){
IPList = [select Name,(select Product_Family__c from Product_Releases_del__r) from Account a where ParentID =: AccountID];
}
else {
IPList = [select Name,(select Product_Family__c from Product_Releases_del__r) from Account a where ParentID =: PAccountID];
}
}
}
This works, I just have no idea what writing test code entails
public String AccountID{get;set;}
public String PAccountID{get;set;}
public List<Account> IPlist{get;set;}
public whitespace(ApexPages.StandardController controller){
AccountID = ApexPages.currentPage().getParameters().get('id');
PAccountID = [select ParentId from Account where ID = :AccountID].ParentId;
if (PAccountID == null){
IPList = [select Name,(select Product_Family__c from Product_Releases_del__r) from Account a where ParentID =: AccountID];
}
else {
IPList = [select Name,(select Product_Family__c from Product_Releases_del__r) from Account a where ParentID =: PAccountID];
}
}
}
This works, I just have no idea what writing test code entails
Following code will work.
All Answers
Following code will work.
Can u share the Page code for the reference.
Thanks
Raj.