File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -249,31 +249,27 @@ pub struct StoredEmail {
249
249
mod tests {
250
250
use super :: * ;
251
251
252
- struct TestEmail ;
253
-
254
- impl Email for TestEmail {
255
- fn subject ( & self ) -> String {
256
- "test" . into ( )
257
- }
258
-
259
- fn body ( & self ) -> String {
260
- "test" . into ( )
261
- }
262
- }
263
-
264
252
#[ tokio:: test]
265
253
async fn sending_to_invalid_email_fails ( ) {
266
254
let emails = Emails :: new_in_memory ( ) ;
267
255
268
256
let address = "String.Format(\" {0}.{1}@live.com\" , FirstName, LastName)" ;
269
- assert_err ! ( emails. send( address, TestEmail ) . await ) ;
257
+ let email = EmailMessage {
258
+ subject : "test" . into ( ) ,
259
+ body_text : "test" . into ( ) ,
260
+ } ;
261
+ assert_err ! ( emails. send( address, email) . await ) ;
270
262
}
271
263
272
264
#[ tokio:: test]
273
265
async fn sending_to_valid_email_succeeds ( ) {
274
266
let emails = Emails :: new_in_memory ( ) ;
275
267
276
268
let address =
"[email protected] " ;
277
- assert_ok ! ( emails. send( address, TestEmail ) . await ) ;
269
+ let email = EmailMessage {
270
+ subject : "test" . into ( ) ,
271
+ body_text : "test" . into ( ) ,
272
+ } ;
273
+ assert_ok ! ( emails. send( address, email) . await ) ;
278
274
}
279
275
}
You can’t perform that action at this time.
0 commit comments