-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Clean up usings, consider default TC config
- Loading branch information
1 parent
3d76a07
commit eb05e63
Showing
8 changed files
with
39 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,25 +21,22 @@ public async Task ReceivesSentMessage() | |
// Given | ||
const string subject = "Test"; | ||
|
||
Message[] messages = []; | ||
using var smtpClient = new SmtpClient(_papercutContainer.Hostname, _papercutContainer.SmtpPort); | ||
|
||
using var httpClient = new HttpClient(); | ||
httpClient.BaseAddress = new Uri(_papercutContainer.GetBaseAddress()); | ||
|
||
using var smtpClient = new SmtpClient(_papercutContainer.Hostname, _papercutContainer.SmtpPort); | ||
|
||
// When | ||
smtpClient.Send("[email protected]", "[email protected]", subject, "A test message"); | ||
|
||
var messagesJson = await httpClient.GetStringAsync("/api/messages") | ||
.ConfigureAwait(true); | ||
|
||
var jsonDocument = JsonDocument.Parse(messagesJson); | ||
messages = jsonDocument.RootElement.GetProperty("messages").Deserialize<Message[]>(); | ||
var messages = jsonDocument.RootElement.GetProperty("messages").Deserialize<Message[]>(); | ||
|
||
// Then | ||
Assert.NotEmpty(messages); | ||
Assert.Equal(subject, messages[0].Subject); | ||
Assert.Single(messages, message => subject.Equals(message.Subject)); | ||
} | ||
|
||
private readonly struct Message | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters