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 @@ -251,31 +251,27 @@ pub struct StoredEmail {
251251mod tests {
252252 use super :: * ;
253253
254- struct TestEmail ;
255-
256- impl Email for TestEmail {
257- fn subject ( & self ) -> String {
258- "test" . into ( )
259- }
260-
261- fn body ( & self ) -> String {
262- "test" . into ( )
263- }
264- }
265-
266254 #[ tokio:: test]
267255 async fn sending_to_invalid_email_fails ( ) {
268256 let emails = Emails :: new_in_memory ( ) ;
269257
270258 let address = "String.Format(\" {0}.{1}@live.com\" , FirstName, LastName)" ;
271- assert_err ! ( emails. send( address, TestEmail ) . await ) ;
259+ let email = EmailMessage {
260+ subject : "test" . into ( ) ,
261+ body_text : "test" . into ( ) ,
262+ } ;
263+ assert_err ! ( emails. send( address, email) . await ) ;
272264 }
273265
274266 #[ tokio:: test]
275267 async fn sending_to_valid_email_succeeds ( ) {
276268 let emails = Emails :: new_in_memory ( ) ;
277269
278270 let address =
"[email protected] " ; 279- assert_ok ! ( emails. send( address, TestEmail ) . await ) ;
271+ let email = EmailMessage {
272+ subject : "test" . into ( ) ,
273+ body_text : "test" . into ( ) ,
274+ } ;
275+ assert_ok ! ( emails. send( address, email) . await ) ;
280276 }
281277}
You can’t perform that action at this time.
0 commit comments