Breaking things
Other than testing what the logic should do, also test what it should not do. Test negative scenarios, like we did in the previous subsection. Let's go back to our example with the billing address, where we change the account and update the mailing addresses of the related contacts. You could also create a test that checks that the mailing addresses of the contacts change if you modify the billing address on an account, which is not related to these contacts. Alternatively, when you modify another field on the account, the mailing address on the related contacts remain the same, even if they are different. You could have made a mistake in your code and instead of querying only the contacts of the account where a change was ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access