You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: approvaltests-util/docs/how_to/LoadersAndSavers.md
+41-18Lines changed: 41 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,29 +233,52 @@ public void sendOutSeniorDiscounts(MailServer mailServer, Loader<List<Customer>>
233
233
}
234
234
}
235
235
```
236
-
Here we're sending out an email message. But we don't really care if it gets sent, we just want to make sure it contains the information we expect. Replacing the MailServer object with a Saver is very similar to the process of introducing a Loader.
236
+
Here we're sending out an email message.
237
+
But we don't really care if it gets sent, we just want to make sure it contains the information we expect.
238
+
Replacing the MailServer object with a Saver is very similar to the process of introducing a Loader.
237
239
238
240
Step 1: Determine the function that we call to save (or in this case, send) the data.
241
+
<!-- Snippet Compare: step4_a, step4_b -->
242
+
<prestyle="color: gray">
243
+
public void sendOutSeniorDiscounts(DataBase database, MailServer mailServer)
Step 2: Determine the data we want to test for its saved state. We start with a test. Unfortunately, since the MailServer is a “write-only” object, it’s hard to determine what’s being sent to it. The Saver gives us the ability to easily test for this state now.:
0 commit comments