+ Start a Discussion
murdocmurdoc 

Create Test for Ignored String

I am attempting to create a valid test for a method that is looking at abbreviations. This is the method:
public static string returnAbbreviationsIgnoredstring(string matchString){
        
        list<string> lstMatchedStrings = matchString.split(' ');
        set<string> setAccountAbbreviations = retrieveAccountAbbreviations();
        string cleanString = '';
        system.debug('##--returnAbbreviationsIgnoredstring.lstMatchedStrings: '+ lstMatchedStrings);
        for(string objString : lstMatchedStrings){
            system.debug('##--objString matches: '+ setAccountAbbreviations.contains(objString));
            if(setAccountAbbreviations.contains(objString.trim().toLowerCase())){
                continue;
            }
            cleanString += objString+ ' ';
        }// end of for-each
        
        system.debug('##--returnAbbreviationsIgnoredstring.cleanString: '+ cleanString);
        return cleanString.trim();
        
    }// end of returnAbbreviationsIgnoredstring
Any help would be greatly appreciated. Thanks.