Skip to content

Add unit and feature tests for Send-MailMessage - #9213

Merged
Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
ThreeFive-O:Send-MailMessage_FeatureTests
May 2, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
ThreeFive-O:Send-MailMessage_FeatureTests

Conversation

@ThreeFive-O

@ThreeFive-O ThreeFive-O commented Mar 23, 2019 •

Copy link
Copy Markdown
Contributor

PR Summary

This PR adds several unit and feature tests for Send-MailMessage cmdlet.

Add unit tests:

  • Cc parameter
  • Bcc parameter
  • To parameter with array

Add feature tests:

  • Port parameter
  • Throw on wrong email address format
  • Free-From email address format
  • Priority parameter
  • BodyAsHtml switch
  • UTF8 Encoding
  • Attachments

PR Context

This PR should check against the behavior of Send-MailMessage before work on a newer implementation of Send-MailMessage cmdlet starts.

PR Checklist

@ThreeFive-O
ThreeFive-O marked this pull request as ready for review March 23, 2019 21:28
@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Mar 26, 2019
@iSazonov Ilya (iSazonov) added this to the 6.3.0-preview.1 milestone Mar 26, 2019
@TravisEz13 Travis Plunk (TravisEz13) changed the title [feature] Add unit and feature tests for Send-MailMessage Add unit and feature tests for Send-MailMessage Mar 26, 2019
@TravisEz13

Copy link
Copy Markdown
Member

Please don't use [feature] in commits, until we are able to remove the old code. All tests are run all the time without this tag now and the tag triggers the old code which was sometimes buggy.

@ThreeFive-O

Copy link
Copy Markdown
Contributor Author

Will do, thank you Travis Plunk (@TravisEz13)!

}
}

Describe "Send-MailMessage Feature Tests" -Tags Feature, RequireSudoOnUnix {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis Plunk (@TravisEz13) Make sense to use Feature tag?

@ThreeFive-O ThreeFive-O Apr 10, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ilya (@iSazonov) Feature tags for Pester are still available, but [feature] tag for commit messages in new PRs are now unnecessary, since all tests will be executed for PRs and daily builds on the CI agents.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Ilya means the -Tags Feature in the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reece Dunham (@RDIL) The way I understood it: Are -Tags Feature is still necessary for this kind of scenario. In my opinion it makes sense to use Feature tag, since the scope of the tests is much broader, than just some basic CI tests. Also those tests influence the time to run all test heavily.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They all seem appropriate to me

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 0735c95 into PowerShell:master May 2, 2019
@adityapatwardhan

Copy link
Copy Markdown
Member

ThreeFive-O Thank you for your contribution!

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants