Im stuck, how can I test the Apex trigger frfing on case before update? Any help appreciated.
Im quite new into this universe so I bear in mind :-) Apex trigger:
trigger CaseEscalationTrigger on Case(before update)
{
for(Case c : Trigger.new)
{
if (c.Escalate_to__c != NULL)
{
String GroupID = c.Escalate_to__c;
c.OwnerId = [SELECT Id FROM Group where Type = 'Queue' And Name = :GroupID].id;
c.Escalate_to__c = '';
}
}
}
Test Class:
@isTest
public class testEscalateToFunction
{
public static testmethod void testAll()
{
// ContentVersion conv=new ContentVersion();
Case c = new Case();
c.Escalate_to__c = '1. SAP';
//update c;
System.assertEquals('', c.Escalate_to__c);
}
}