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

How to Cover This lines in Test Class
public List<String> kamNa {
get {
if (kamNames == null) {
kamNames = new List<String>();
Schema.DescribeFieldResult field1 = Brokerage__c.Control__c.getDescribe();
for (Schema.PicklistEntry f : field.getPicklistValues())
kamNa.add(f.getLabel());
}
return kamNa;
}
set;
}
get {
if (kamNames == null) {
kamNames = new List<String>();
Schema.DescribeFieldResult field1 = Brokerage__c.Control__c.getDescribe();
for (Schema.PicklistEntry f : field.getPicklistValues())
kamNa.add(f.getLabel());
}
return kamNa;
}
set;
}
There was a mistake in code provided by me which i have ocrrected now.
So please try with this updated code :
Let me know if you still have any issue.
Thanks,
Abhishek
All Answers
Please try with below code : Please let me know if there is any issue with above code.
Thanks,
Abhishek
No it wont work
becz the this is not a static variable
and the testController and controller reference the same class
i tried it gave me an error of controller.kamNa variable not defined
thanku for your reply
There was a mistake in code provided by me which i have ocrrected now.
So please try with this updated code :
Let me know if you still have any issue.
Thanks,
Abhishek
FYI, you can try a new salesforce development IDE named Metaforce on chrome application platform. it's a great tool for coding, deploying, etc.. you can try to search and install it in chrome webstore or click this link.(https://chrome.google.com/webstore/detail/metaforce/hhnkaakhlhngcdckdiogpkjihnmgodep)