You need to sign in to do that
Don't have an account?
Rolando Esteves
Problem with testmethod
Im currently working on my testclass but when I do the calls its not covering the for loop inside my method. How do you test the code lines inside the for loop.
Code to be tested:
public List<String> getLst() { for(Product__c prod: [SELECT Product_Logo__c FROM Product__c ORDER BY Name]) { imageTag = prod.Product_Logo__c; strt = imageTag.indexOf('src=',0) + 5; ed = imageTag.lastIndexOf('alt=') - 2; tmp = imageTag.substring(strt,ed); img_Lst.add(tmp); } return img_Lst; }
Hi
will you make sure that you have written test method like this
All Answers
If you use existing data for test, make sure your for loop can get at lease one Product__c record to process.
Hi
will you make sure that you have written test method like this