From 6da78f8dba65cbb75ed5a7a3c22dbce76e4f0da0 Mon Sep 17 00:00:00 2001 From: Jon M Date: Sat, 16 Sep 2023 08:11:41 +0100 Subject: [PATCH] Fix interpolation of optionals --- Tests/MailosaurTests/EmailsTests.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/MailosaurTests/EmailsTests.swift b/Tests/MailosaurTests/EmailsTests.swift index 554d9f9..3650649 100644 --- a/Tests/MailosaurTests/EmailsTests.swift +++ b/Tests/MailosaurTests/EmailsTests.swift @@ -185,7 +185,7 @@ final class EmailsTests: XCTestCase { try XCTSkipIf(EmailsTestsSetup.verifiedDomain == nil, "Skipping test") let subject = "New message" - let message = try await EmailsTestsSetup.client.messages.create(server: EmailsTestsSetup.server, messageCreateOptions: MessageCreateOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain)", + let message = try await EmailsTestsSetup.client.messages.create(server: EmailsTestsSetup.server, messageCreateOptions: MessageCreateOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain ?? "")", send: true, subject: subject, text: "This is a new email")) @@ -196,9 +196,9 @@ final class EmailsTests: XCTestCase { func testCreateSendHtml() async throws { try XCTSkipIf(EmailsTestsSetup.verifiedDomain == nil, "Skipping test") - + let subject = "New HTML message" - let message = try await EmailsTestsSetup.client.messages.create(server: EmailsTestsSetup.server, messageCreateOptions: MessageCreateOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain)", + let message = try await EmailsTestsSetup.client.messages.create(server: EmailsTestsSetup.server, messageCreateOptions: MessageCreateOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain ?? "")", send: true, subject: subject, html: "

This is a new email.

")) @@ -216,7 +216,7 @@ final class EmailsTests: XCTestCase { fileName: "cat.png", content: data.base64EncodedString()) - let message = try await EmailsTestsSetup.client.messages.create(server: EmailsTestsSetup.server, messageCreateOptions: MessageCreateOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain)", + let message = try await EmailsTestsSetup.client.messages.create(server: EmailsTestsSetup.server, messageCreateOptions: MessageCreateOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain ?? "")", send: true, subject: subject, html: "

This is a new email.

", @@ -237,7 +237,7 @@ final class EmailsTests: XCTestCase { let body = "Forwarded message" let targetEmail = EmailsTestsSetup.emails[0] - let message = try await EmailsTestsSetup.client.messages.forward(id: targetEmail.id, messageForwardOptions: MessageForwardOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain)", + let message = try await EmailsTestsSetup.client.messages.forward(id: targetEmail.id, messageForwardOptions: MessageForwardOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain ?? "")", text: body)) XCTAssertFalse(message.id.isEmpty) @@ -250,7 +250,7 @@ final class EmailsTests: XCTestCase { let body = "

Forwarded HTML message.

" let targetEmail = EmailsTestsSetup.emails[0] - let message = try await EmailsTestsSetup.client.messages.forward(id: targetEmail.id, messageForwardOptions: MessageForwardOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain)", + let message = try await EmailsTestsSetup.client.messages.forward(id: targetEmail.id, messageForwardOptions: MessageForwardOptions(to: "anything@\(EmailsTestsSetup.verifiedDomain ?? "")", html: body)) XCTAssertFalse(message.id.isEmpty)