Skip to content

Commit

Permalink
Changes in ADDR_Addresses_TEST.cls
Browse files Browse the repository at this point in the history
Changes added in 'updatedUndeliverableAddressShouldSyncToAccountAndHouseholdContactOverrides' test method
  • Loading branch information
salesforce-suyash-more committed Sep 26, 2024
1 parent 6784234 commit 2aa4354
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions force-app/test/ADDR_Addresses_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,9 @@ public with sharing class ADDR_Addresses_TEST {
break;
}
}

contact.is_Address_Override__c = true;
update contact;

Test.startTest();
overrideAddress.Undeliverable__c = true;
update overrideAddress;
Expand All @@ -828,12 +830,9 @@ public with sharing class ADDR_Addresses_TEST {
Contact updatedContact = [SELECT is_Address_Override__c, Current_Address__c, Current_Address__r.MailingStreet__c, Undeliverable_Address__c
FROM Contact
WHERE Id = :contact.Id];
System.assert(updatedContact.Current_Address__c == overrideAddress.Id, 'Contact should have the override ' +
'address as its current address.');

System.assert(updatedContact.is_Address_Override__c == true, 'The contact address override should be true.');
System.assertEquals(overrideAddress.Undeliverable__c, updatedContact.Undeliverable_Address__c, 'The contact ' +
'undeliverable address status should match the override address undeliverable status.');
System.assert(updatedContact.Undeliverable_Address__c == false, 'The contact address Undeliverable__c should be false after the override undeliverable.');
}


Expand Down

0 comments on commit 2aa4354

Please sign in to comment.