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

Test Method Which Uses Public Variable
Hi I am new to Apex, and I need to create a Test for a method that references a Public variable(ClientIdList) see below:
public Void getRb() {
List <laserapp3__Ben2__c> relatedBene = new List<laserapp3__Ben2__c> (
[
SELECT
name,
ownerid,
Policy_Number__c,
Insurance__c,
Financial_Account_Number__c,
laserapp3__Percentage__c,
laserapp3__Relationship__c,
laserapp3__First__c,
laserapp3__Last__c,
laserapp3__Account__c,
Financial_Account__c
FROM laserapp3__Ben2__c
where laserapp3__Account__c in :ClientIdList
order by Financial_Account_Number__c nulls last, Policy_Number__c
]
);
Id myId;
for (laserapp3__Ben2__c ar : relatedBene)
{
myId = (Id)ar.get('laserapp3__Account__c');
BeneMap.put(myId,getClientName(ar.laserapp3__Account__c));
}
Rb = relatedBene;
}
Can anyone please help me understand what the Test method should be to test this properly? THANKS!
what is ClientIdList and Could you please post the whole code as how it is being used so that I can help.