-
Notifications
You must be signed in to change notification settings - Fork 5k
Add more tests for SmtpClient #114690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more tests for SmtpClient #114690
Conversation
Tagging subscribers to this area: @dotnet/ncl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- src/libraries/System.Net.Mail/tests/Functional/System.Net.Mail.Functional.Tests.csproj: Language not supported
src/libraries/System.Net.Mail/tests/Functional/SmtpClientAttachmentTest.cs
Outdated
Show resolved
Hide resolved
…hmentTest.cs Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Thanks
Some tests failures from checks seems to be related to given changes.
@@ -201,13 +247,32 @@ await SendMessageAsync( | |||
|
|||
switch (command.ToUpper()) | |||
{ | |||
case "STARTTLS": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
This PR adds a number of functional tests for the SmptClient. The idea is to map out the current behavior of all 3 ways of sending messages:
This will give us more confidence for potential future modernization of the code base.
Combining with Unit tests (untouched in this PR), this increases the line coverage from 67% to 75% and branch coverage from 59% to 63%. Lines of interest that are not yet covered seem to be mostly exception propagation in the asynchronous Begin/End method chains and would require targeted test for each step of the chain to cover fully.