+ Start a Discussion
karthikeya 2karthikeya 2 

code coverage for csv file

Hi all,
Please help in writing test code coverage for following code.

if(extension != 'csv' ||extension != 'CSV')
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'The file must be in comma delimited format (.csv). Please upload an appropriate file format.');
            return null;

Thanks in Advance.
Pradeep Kumar L.GPradeep Kumar L.G
I am not sure about rest of your code, but looking at above code. It clearly says if you are able to set the "extention" value to other than "csv" or "CSV" you should be able to cover the code.

Can you please share your class code and test code which you have written so far?

Ashlekh Gera