-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1017 from bcgov/defect-ALR-1802
ALR-1802
- Loading branch information
Showing
2 changed files
with
49 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,15 +16,17 @@ private class ScheduleSendEmailTest { | |
Account acc = TestDataFactory.createResidence('Residence', 'residence1', regAuth.Id, true); | ||
accList.add(acc); | ||
|
||
Account accRec = [SELECT Id ,ParentId FROM Account where Id =: acc.Id]; | ||
Account accRec = [SELECT Id , Name , ParentId FROM Account where Id =: acc.Id]; | ||
|
||
Contact con = new Contact( | ||
FirstName = 'Test', | ||
LastName = 'Contact', | ||
Email = '[email protected]' | ||
Email = '[email protected]', | ||
AccountId=accRec.Id | ||
); | ||
insert con; | ||
|
||
|
||
|
||
AccountContactRelation acr = new AccountContactRelation( | ||
AccountId = acc.Id, | ||
ContactId = con.Id, | ||
|
@@ -39,30 +41,5 @@ private class ScheduleSendEmailTest { | |
List<EmailTemplate> emailTem = [SELECT Id FROM EmailTemplate]; | ||
System.assertEquals(True, emailTem.size()>0, 'No Email is sent'); | ||
} | ||
|
||
@isTest | ||
static void testSendRenewalDueEmail() { | ||
|
||
|
||
List<Account> accList = new List<Account>(); | ||
|
||
// Create an instance of DMLOptions | ||
Database.DMLOptions dmlOptions = new Database.DMLOptions(); | ||
dmlOptions.DuplicateRuleHeader.allowSave = true; | ||
|
||
RegulatoryAuthorizationType regAuth = TestDataFactory.createRegAuth('Mental Health', 'License', 'MH', 1, 2, 3, 4, true); | ||
|
||
Account Residence = TestDataFactory.createResidence('Residence', 'hgvfjmhhgsu', regAuth.Id, true); | ||
|
||
Contact contactRec = TestDataFactory.createContactRecord(Residence.Id, '[email protected]', 'uysgyuskgfh', 'hsguh', true); | ||
|
||
//AccountContactRelation acConRelRec = TestDataFactory.createAccContRelRecord(Residence.Id, contactRec.Id , true, true, true); | ||
|
||
List<Id> contactIds = new List<Id>{ contactRec.Id }; | ||
Test.startTest(); | ||
ScheduleSendEmail.sendRenewalDueEmail(contactIds); | ||
Test.stopTest(); | ||
List<EmailTemplate> emailTem = [SELECT Id FROM EmailTemplate]; | ||
System.assertEquals(True, emailTem.size()>0, 'No Email is sent'); | ||
} | ||
|
||
} |