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