Skip to content

Commit

Permalink
test class
Browse files Browse the repository at this point in the history
  • Loading branch information
Kipa24 committed Jun 24, 2024
1 parent 0e0f93d commit 8f9ea0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/main/default/classes/ScheduleSendEmailTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ private class ScheduleSendEmailTest {
System.schedule('TestSchedule', cronExp, new ScheduleSendEmail());

Test.stopTest();

List<EmailTemplate> emailTem = [SELECT Id FROM EmailTemplate];
System.assertEquals(1, emailTem.size(), 'Expected 1 email to be sent');

}

Expand All @@ -51,5 +54,8 @@ private class ScheduleSendEmailTest {
Test.startTest();
ScheduleSendEmail.sendRenewalDueEmail(contactIds);
Test.stopTest();

List<EmailTemplate> emailTem = [SELECT Id FROM EmailTemplate];
System.assertEquals(1, emailTem.size(), 'Expected 1 email to be sent');
}
}
6 changes: 4 additions & 2 deletions src/main/default/classes/ScheduledEmailTriggerTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ private class ScheduledEmailTriggerTest {
System.schedule('TestScheduledEmailTrigger', cronExp, new ScheduledEmailTrigger());

Test.stopTest();

List<EmailTemplate> emailTem = [SELECT Id FROM EmailTemplate];
System.assertEquals(1, emailTem.size(), 'Expected 1 email to be sent');

}

Expand All @@ -61,6 +62,7 @@ private class ScheduledEmailTriggerTest {

Test.stopTest();


List<EmailTemplate> emailTem = [SELECT Id FROM EmailTemplate];
System.assertEquals(1, emailTem.size(), 'Expected 1 email to be sent');
}
}

0 comments on commit 8f9ea0a

Please sign in to comment.