diff --git a/src/PhoneNumbers/DataFiles/MX.txt b/src/PhoneNumbers/DataFiles/MX.txt index c6ee0b671..cbcb6c4e7 100644 --- a/src/PhoneNumbers/DataFiles/MX.txt +++ b/src/PhoneNumbers/DataFiles/MX.txt @@ -8,5 +8,6 @@ G|6|Noroeste|100000000-999999999| G|7|Sur oeste|100000000-999999999| G|8|Noreste|100000000-999999999| G|9|Sureste|100000000-109999999,129999999-999999999| -N|2-9||000000000-099999999| +N|2-8||000000000-099999999| N|5||000000000-099999999|V +N|9||000000000-099999999|R diff --git a/test/PhoneNumbers.Data.Tests/Parsers/DefaultPhoneNumberParserTests_MX_NonGeographicPhoneNumber.cs b/test/PhoneNumbers.Data.Tests/Parsers/DefaultPhoneNumberParserTests_MX_NonGeographicPhoneNumber.cs index 8b3a2c21d..139765218 100644 --- a/test/PhoneNumbers.Data.Tests/Parsers/DefaultPhoneNumberParserTests_MX_NonGeographicPhoneNumber.cs +++ b/test/PhoneNumbers.Data.Tests/Parsers/DefaultPhoneNumberParserTests_MX_NonGeographicPhoneNumber.cs @@ -30,10 +30,33 @@ public void Parse_Known_NonGeographicPhoneNumber_2_NationalDestinationCode(strin Assert.Equal(subscriberNumber, nonGeographicPhoneNumber.SubscriberNumber); } + [Theory] + [InlineData("8000000000", "8", "000000000")] + [InlineData("8099999999", "8", "099999999")] + public void Parse_Known_NonGeographicPhoneNumber_8_NationalDestinationCode(string value, string NationalDestinationCode, string subscriberNumber) + { + var parseResult = s_parser.Parse(value); + parseResult.ThrowIfFailure(); + + var phoneNumber = parseResult.PhoneNumber; + + Assert.NotNull(phoneNumber); + Assert.IsType(phoneNumber); + + var nonGeographicPhoneNumber = (NonGeographicPhoneNumber)phoneNumber; + Assert.Equal(CountryInfo.Mexico, nonGeographicPhoneNumber.Country); + Assert.False(nonGeographicPhoneNumber.IsFreephone); + Assert.False(nonGeographicPhoneNumber.IsMachineToMachine); + Assert.False(nonGeographicPhoneNumber.IsPremiumRate); + Assert.False(nonGeographicPhoneNumber.IsSharedCost); + Assert.Equal(NationalDestinationCode, nonGeographicPhoneNumber.NationalDestinationCode); + Assert.Equal(subscriberNumber, nonGeographicPhoneNumber.SubscriberNumber); + } + [Theory] [InlineData("9000000000", "9", "000000000")] [InlineData("9099999999", "9", "099999999")] - public void Parse_Known_NonGeographicPhoneNumber_9_NationalDestinationCode(string value, string NationalDestinationCode, string subscriberNumber) + public void Parse_Known_NonGeographicPhoneNumber_PremiumRate(string value, string NationalDestinationCode, string subscriberNumber) { var parseResult = s_parser.Parse(value); parseResult.ThrowIfFailure(); @@ -47,7 +70,7 @@ public void Parse_Known_NonGeographicPhoneNumber_9_NationalDestinationCode(strin Assert.Equal(CountryInfo.Mexico, nonGeographicPhoneNumber.Country); Assert.False(nonGeographicPhoneNumber.IsFreephone); Assert.False(nonGeographicPhoneNumber.IsMachineToMachine); - Assert.False(nonGeographicPhoneNumber.IsPremiumRate); + Assert.True(nonGeographicPhoneNumber.IsPremiumRate); Assert.False(nonGeographicPhoneNumber.IsSharedCost); Assert.Equal(NationalDestinationCode, nonGeographicPhoneNumber.NationalDestinationCode); Assert.Equal(subscriberNumber, nonGeographicPhoneNumber.SubscriberNumber);