You need to sign in to do that
Don't have an account?
Sujit Karande
Check for string value in test class
I have an apex class which checks for the value of String. For eg :
Any suggestion how could I do this?
String region = opportunity.Region_c; if(region!=null){ if(region.equals('India')){ //Do someting } else if(region.equals('US')){ // do something } }And I have written a test class but it only tests if(region!=null) and inner if conditions are not getting tested which is why it is not reaching the criteria of 75% of code coverage.
Any suggestion how could I do this?
Ryan Greene
If the test is skipping your inner ifs, it must not have an opportunity.Region__c set in your test. If it is set on your test, could you share your test class to see if there's an issue there?