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 {
249249mod tests {
250250 use super :: * ;
251251
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-
264252 #[ tokio:: test]
265253 async fn sending_to_invalid_email_fails ( ) {
266254 let emails = Emails :: new_in_memory ( ) ;
267255
268256 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 ) ;
270262 }
271263
272264 #[ tokio:: test]
273265 async fn sending_to_valid_email_succeeds ( ) {
274266 let emails = Emails :: new_in_memory ( ) ;
275267
276268 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 ) ;
278274 }
279275}
You can’t perform that action at this time.
0 commit comments