4 answers

Hi Erica,Firstly create a 'CaseTeamRole' in your ORG and gave Name = 'Creator' of CaseTeamRole. And then try the following test class, it covers 82% code coverage of your code in my ORG.
@IsTest
public class AddCaseCreatorasaTeamMember_Test {
@IsTest
public static void methodTest1(){
Id RecordTypeIdCase = Schema.SObjectType.Case.getRecordTypeInfosByName().get('Customer Support').getRecordTypeId();
Case caseInst=new Case();
caseInst.Origin='Phone';
caseInst.Status='New';
caseInst.recordtypeid=RecordTypeIdCase;
insert caseInst;
}
}
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,Deepali Kulshrestha