Skip to main content

Below is my code and please let me know what I am doing wrong that I am unable to get through the challenge. (The 'generateRandomContacts' method failed to execute. Either the method does not exist, is not static, or did not return the correct set of Contact records.)

@isTest

public class RandomContactFactory{

public static List<Contact> generateRandomContacts(Integer numCnt, String fname) {

List<Contact> cntkt = new List<Contact>();

for(Integer i=0;i<numCnt;i++) {

cntkt.add(new Contact(firstName=fname + ' ' + i));

}

return cntkt;

}

}

5 respostas
  1. 6 de ago. de 2021, 02:58

    Hi,

     I don't think @isTest is needed.

0/9000