question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support generating MailAddress instances

See original GitHub issue

It would be great if FsCheck would be able to generate MailAddress instances. I could work on this, but first I’d like to know if this is something that you’d support.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
kurtschelfthoutcommented, Oct 26, 2018

That’s probably because we only target net standard 1.6 now, which doesn’t have MailAddress. I’m planning to target 2.0 specifically as per nuget recommendations in the next minor release, which should solve that (if MailAddress is in the 2.0 API surface, that is).

1reaction
ploehcommented, May 14, 2016

As a an experienced programmer, I’d like a MailAddress generator to seek out as many exotic values as possible. You may want to consider the following, however:

If the target is to generate MailAddress values, you may need to constrain the generated values to those that MailAddress considers valid. It wouldn’t surprise me if there are strings that are considered valid according to whatever specification defines SMTP addresses, but that MailAddress doesn’t accept.

On the other hand, if that’s the case, then .NET is open source too, as well 😉

The other issue worth considering is that some generated email addresses may represent real addresses.

When FsCheck is used against pure functions, that isn’t an issue, but if someone ever decides to use FsCheck for integration testing, a side effect could be that email are sent to real mail boxes.

If that ever happens, if someone wants to place the blame, the only reasonable target for the blame ought to be the developer who chose to use FsCheck against code that sends email. Still, some people aren’t reasonable, particularly when their ass is on the line, so we could hypothetically risk that someone tries to blame FsCheck.

I still think we should generate addresses according to all sorts of edge cases, but I think at least we should put a warning in the documentation to the effect that it may generate real addresses, and that it’s the users’ responsibility if emails are sent to real mail boxes as a result of running tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MailAddress Class (System.Net.Mail)
The MailAddress class supports the following mail address formats: A simple address format of user@host . If a DisplayName is not set, this...
Read more >
Adding support email addresses for users to submit tickets
You can provide your users with alternative email addresses for submitting tickets. These addresses are known as support addresses.
Read more >
How to find instance email address
Solved: Hi Is there some kind of hidden system property that holds a instance's email address?
Read more >
Ideas for Creating a Professional Email Address + Examples
This guide provides the best practices and email ideas for businesses to help you create a professional email address. 1. Ease of pronunciation....
Read more >
Professional Email Address Examples (Plus How To ...
Learn the purpose of having a professional email address, explore a how-to guide for creating an email address for work and review examples...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found