You need to sign in to do that
Don't have an account?
sfdc development hints
H
i , can anyone help me writing a test class for below class
global class my_case_extensions
{
webservice static void closedcase(ID CaseId)
{
List<Case> list_Case = [Select Id,Status from Case where Id=: CaseId];
if(!list_Case.isEmpty())
{
list_Case[0].Status = 'Closed';
update list_Case;
}
}
}
Hi,
Try the following code:
@isTest
class SampleClass
{
public static tesMethod void sampleMethod()
{
Case c=new Case(Status='New',Origin='Email');
insert c;
Test.startTest();
my_case_extensions.closedcase(c.id);
Test.stopTest();
}
}
All Answers
Hi,
Try the following code:
@isTest
class SampleClass
{
public static tesMethod void sampleMethod()
{
Case c=new Case(Status='New',Origin='Email');
insert c;
Test.startTest();
my_case_extensions.closedcase(c.id);
Test.stopTest();
}
}
Thanks..