Skip to content

Commit 30a7f33

Browse files
committed
email: Remove TestEmail struct
1 parent 57f7cca commit 30a7f33

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/email.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -251,31 +251,27 @@ pub struct StoredEmail {
251251
mod 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
}

0 commit comments

Comments
 (0)