You need to sign in to do that
Don't have an account?
Sami Ullah Azam
Write test case for Void Method without any parameters.
I have a method that returns nothing and take no parameters. It just take values from VF page and query the Object to retrieve results and set them to variables. How can I write test case for this functions.?
Please Help!!
Please Help!!
can you share you whole code of class so that it will be easy to know about which variables are initializes when page loaded.?
These are picklists that directly coming from VF page. Some values I am triming here and some using directly. The wohle code of class is so much big. If it causing the problem to understand the method, I will share the whole code.Thanks
CLASSNAME obj= new CLASSNAME();
obj.c.level__c ='AMC';
obj.updateValvePrice();
Let us know if this will help you
Hi Chaudhary,
Thanks for the reply, I was busy with other tasks. I test it now but I am getting error of " System.NullPointerException: Attempt to de-reference a null object". The code is working fine when I use string instead of "c.level__c". c.level__c is a field of an object. Can you please tell me how can I test the method using the fields of an object. I initialize the c.level__c in constructor but didn't work.
your help shall be highly appreciated!
Thanks
Sami