oriches / faker-cs

C# port of the Ruby Faker gem (http://faker.rubyforge.org/)
MIT License
180 stars 52 forks source link

520.347.9933 x3179 is not a phone number #20

Open RwSgxx opened 3 years ago

RwSgxx commented 3 years ago

version: 1.5.148

The generated phone numbers are not valid?

  1. They look strange.
  2. They are not parsable by google phone lib.
Siliconrob commented 3 years ago

Why are you not opening this as an issue with google?

Because I agree with this assessment on phone numbers https://github.com/bchavez/Bogus/issues/393#issuecomment-927376097

gerardkmiec commented 2 years ago

Can't believe that this issue is still not fixed in the current version...

Siliconrob commented 2 years ago

What do you want it to do? Please be clear because conforming to some google library parser may not be correct. What I mean by clarity is write a test optimally or describe the input -> output

Like: 1-800-123-1234 -> True i like mittens on kittens -> False

@gerardkmiec

gerardkmiec commented 2 years ago

@Siliconrob As OP wrote- generating phone number doesn't return valid format. It looks like 1-049-437-6557 x3237 which is not acceptable. image

Siliconrob commented 2 years ago

How are you supposed to handle extensions? Because phone numbers do have extensions. Even this google parser thing says that.

or an extension portion

Maybe what you want is an override to not return phone numbers with extensions, but that would be limiting your dataset responses and give the false confidence in your workflows because someone will come along with a phone number that does have an extension and what do you do then?

gerardkmiec commented 2 years ago

I'm not sure if we understand each other. What do you mean by extension? The part of this generated number which causes an issue for me, is "x3237" . How could someone dial "x" on the phone? Also, I never saw that someone would provide a phone number such as "1-049-437-6557 x3237" in any input field

Siliconrob commented 2 years ago

You wouldn't dial the x part usually you would do a comma by pressing the * key and selecting , or maybe * and a : there are a lot of options and an x is to indicate you will need to pause until after connected before dialing in the extension. I mean that x predates IVR systems so those are the common tools approaches.

If it was a human you would dial first part, connect, wait for automated routing system to respond and then dial extension number etc.

I mean it is a bit more rare to have an input enter a phone number with an extension because sharing a phone line is mostly a business operation and nowadays emails are probably better than messing with the hassle of internal extensions.