You need to sign in to do that
Don't have an account?
NaypersMclgx
Test Method to Cover, help to cover this small function
Hi everyone!
I hope somebody can help me, I'd like to cover this function but I can't get it (not even a line)
Do you now what's going on?.. thanks for your time..
public with sharing class MyController { public List<SelectOption> getGenerateOptions(String value){ value = (value == null) ? '' : value; List<SelectOption> elements = new List<SelectOption>(); elements.add(new SelectOption(value, value)); elements.add(new SelectOption('', '----')); for(Integer i=0; i < 11; i++){ elements.add(new SelectOption('' + i, '' + i)); } return elements; } // ... } static testmethod void myTest(){ MyController test = new MyController(); test.getGenerateOptions('5'); // ... }
Hi,
The test method must be in the class.