function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mrityunjay Patel 18Mrityunjay Patel 18 

how to write the test method for this type of code ?


Map<String, Set<String>> shopFldToValMap = new Map<String, Set<String>>();
 Map<Integer, String> indexToShopFld = new Map<Integer, String>();
 shopFldToValMap.get(indexToShopFld.get(i)).size() != 0) {
                                      String condtn ;
                                      if(indexToCondn.get(i) == 'equals') {
                                          for(String s : shopFldToValMap.get(indexToShopFld.get(i))) {
                                              if(s != null && s.length() != 0) {
                                                  if(condtn != null) {
                                                      condtn += ' or ';
                                                      condtn += '('+indexToSfFld.get(i);
                                                  } else {
                                                      condtn = '('+indexToSfFld.get(i);
                                                  }
                                                  if(s != null) {
                                                      s = String.escapeSingleQuotes(s);
                                                  }
                                                  s = '\''+s+'\'';
                                                  condtn += ' = '+s+')' ;
                                              }
Thanks in advance
PriyaPriya (Salesforce Developers) 

The developer community recommends providing any attempts/code you've started, any errors you're getting, or where exactly you're struggling in achieving this while posting a question.