Skip to main content
added 4 characters in body
Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

In your trigger if block you,you are checkchecking if case is canceled.

if(c.Status == 'Cancelled')

and in your test class you are setting it as 9-Cancelled and as Cancelled is not equal to 9-Cancelled , its not entering the block.

You can fix it by fixing the case status in test class.

    test.startTest();
    c.Status= 'Cancelled';
    update c;
    test.stopTest()

In your trigger if block you are check if case is canceled.

if(c.Status == 'Cancelled')

and in your test class you are setting it as 9-Cancelled and as Cancelled is not equal to 9-Cancelled , its not entering the block.

You can fix it by fixing the case status in test class.

    test.startTest();
    c.Status= 'Cancelled';
    update c;
    test.stopTest()

In your trigger if block ,you are checking if case is canceled.

if(c.Status == 'Cancelled')

and in your test class you are setting it as 9-Cancelled and as Cancelled is not equal to 9-Cancelled , its not entering the block.

You can fix it by fixing the case status in test class.

    test.startTest();
    c.Status= 'Cancelled';
    update c;
    test.stopTest()
Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

In your trigger if block you are check if case is canceled.

if(c.Status == 'Cancelled')

and in your test class you are setting it as 9-Cancelled and as Cancelled is not equal to 9-Cancelled , its not entering the block.

You can fix it by fixing the case status in test class.

    test.startTest();
    c.Status= 'Cancelled';
    update c;
    test.stopTest()