You need to sign in to do that
Don't have an account?
KevSnell
TestMethod - Integer Count Help
Hey All,
Sorry still trying to understand testmethods and hopefully someone can answer this pretty quickly.
I have a controller that does the below for a VF Page:
Public static integer getUnQualified() { integer UnQualified = [SELECT count() FROM Lead where OwnerId =:UserInfo.getUserId() AND Status='Unqualified' AND IsConverted = False ]; return UnQualified ; }
However how do I write a test method for this?
As far as I can understand I need to:
Start Test
Set Current Page
New Controller
Insert Lead with Status = Unqualifed
Check that Count returns result
Stop Test
My issue is I don't know how to test the count function.
Thanks in advance.
Kev
getUnQualified() function is simply returning an integer with no parameters.
That means its a get method which returns an integer value.
So to cover that function you just have to get the value from that function.
All Answers
getUnQualified() function is simply returning an integer with no parameters.
That means its a get method which returns an integer value.
So to cover that function you just have to get the value from that function.
Thanks - I had just read something that meant I came to the same solution.