-
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 #22 from preeti-preeti/JhirdChanges
Jhird changes
- Loading branch information
Showing
3 changed files
with
106 additions
and
16 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
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 |
---|---|---|
|
@@ -477,4 +477,92 @@ public with sharing class EscalationTeamTrigger_Test { | |
|
||
System.assertEquals(testUser.Id, testEscalationTeam2.rh_escal__User__c, 'The team member should not have been added'); | ||
} | ||
|
||
static testMethod void changeInternalDoesNotTriggerDupeExceptionForEmailContact() { | ||
Account testAccount = TestUtils.getAccount(); | ||
insert testAccount; | ||
|
||
String email = '[email protected]'; | ||
|
||
rh_escal__Escalation__c testEscalation = TestUtils.getEscalation(); | ||
insert testEscalation; | ||
|
||
testEscalation = TestUtils.fetchEscalation(testEscalation); | ||
|
||
rh_escal__EscalationTeam__c testEscalationTeam = TestUtils.getEscalationTeam(testEscalation, email); | ||
testEscalationTeam.rh_escal__Internal__c =false; | ||
insert testEscalationTeam; | ||
|
||
testEscalationTeam.rh_escal__Internal__c = true; | ||
|
||
BaseTrigger.triggerNameToInfoMap.clear(); | ||
|
||
Test.startTest(); | ||
|
||
update testEscalationTeam; | ||
|
||
Test.stopTest(); | ||
|
||
testEscalationTeam = TestUtils.fetchEscalationTeam(testEscalationTeam); | ||
System.assert(testEscalationTeam.rh_escal__Internal__c, 'Internal should be true'); | ||
} | ||
|
||
static testMethod void changeInternalDoesNotTriggerDupeExceptionForContact() { | ||
Account testAccount = TestUtils.getAccount(); | ||
insert testAccount; | ||
|
||
Contact testContact = TestUtils.getContact(testAccount, 'testContact1'); | ||
insert testContact; | ||
|
||
rh_escal__Escalation__c testEscalation = TestUtils.getEscalation(); | ||
insert testEscalation; | ||
|
||
testEscalation = TestUtils.fetchEscalation(testEscalation); | ||
|
||
rh_escal__EscalationTeam__c testEscalationTeam = TestUtils.getEscalationTeam(testEscalation, testContact, false); | ||
insert testEscalationTeam; | ||
|
||
testEscalationTeam.rh_escal__Internal__c = true; | ||
|
||
BaseTrigger.triggerNameToInfoMap.clear(); | ||
|
||
Test.startTest(); | ||
|
||
update testEscalationTeam; | ||
|
||
Test.stopTest(); | ||
|
||
testEscalationTeam = TestUtils.fetchEscalationTeam(testEscalationTeam); | ||
System.assert(testEscalationTeam.rh_escal__Internal__c, 'Internal should be true'); | ||
} | ||
|
||
static testMethod void changeInternalDoesNotTriggerDupeExceptionForUser() { | ||
Account testAccount = TestUtils.getAccount(); | ||
insert testAccount; | ||
|
||
Contact testContact = TestUtils.getContact(testAccount, 'testContact1'); | ||
insert testContact; | ||
|
||
rh_escal__Escalation__c testEscalation = TestUtils.getEscalation(); | ||
insert testEscalation; | ||
|
||
testEscalation = TestUtils.fetchEscalation(testEscalation); | ||
|
||
rh_escal__EscalationTeam__c testEscalationTeam = TestUtils.getEscalationTeam(testEscalation, TestUtils.getAdminUser()); | ||
testEscalationTeam.rh_escal__Internal__c =false; | ||
insert testEscalationTeam; | ||
|
||
testEscalationTeam.rh_escal__Internal__c = true; | ||
|
||
BaseTrigger.triggerNameToInfoMap.clear(); | ||
|
||
Test.startTest(); | ||
|
||
update testEscalationTeam; | ||
|
||
Test.stopTest(); | ||
|
||
testEscalationTeam = TestUtils.fetchEscalationTeam(testEscalationTeam); | ||
System.assert(testEscalationTeam.rh_escal__Internal__c, 'Internal should be true'); | ||
} | ||
} |