Skip to content

Commit 328327b

Browse files
committed
email: Remove TestEmail struct
1 parent 6c008b9 commit 328327b

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
@@ -249,31 +249,27 @@ pub struct StoredEmail {
249249
mod 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
}

0 commit comments

Comments
 (0)