Skip to content

Commit

Permalink
Closes #667
Browse files Browse the repository at this point in the history
Update Gibraltar Numbers
  • Loading branch information
TrevorPilley committed Jun 8, 2024
1 parent f3f9faf commit 7642c3f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Estonia | EE | 372 | | | Yes
Finland | FI | 358 | 0 | Yes | Yes | | | Yes | Yes | | | Yes
France | FR | 33 | 0 | | Yes | | | Yes | Yes | Yes | | Yes
Germany | DE | 49 | 0 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | | Yes
Gibraltar | GI | 350 | | Yes | Yes | | | | Yes | Yes | |
Gibraltar | GI | 350 | | Yes | Yes | | | | Yes | Yes | Yes |
Greece | GR | 30 | | Yes | Yes | | Yes | Yes | Yes | Yes | Yes | Yes
Guernsey | GG | 44 _(UK)_ | 0 | Yes | Yes | | | | | | |
Hungary | HU | 36 | 06 | Yes | Yes | | | Yes | Yes | Yes | | Yes
Expand Down
2 changes: 2 additions & 0 deletions src/PhoneNumbers/DataFiles/EE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Reference: https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000430002PDFE.pdf
# Reference Date: 18/07/2018
N|32-33,35,38-39,43-48,60-68,71-79,88||00000-99999|
N|40||000000-999999|
M|50-59||00000-999999|
Expand Down
2 changes: 2 additions & 0 deletions src/PhoneNumbers/DataFiles/FI.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Reference: https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000490003PDFE.pdf
# Reference Date: 23/08/2017
N|100,200,2021,2024-2029,2090-2097||0000-999999|
N|101-109,201,203-208,301-309||00000-9999999|
G|13|Pohjois-Karjala|10000-8999999|
Expand Down
18 changes: 13 additions & 5 deletions src/PhoneNumbers/DataFiles/GI.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
G|200|Gibraltar|00000-49999,50000-50999,51000-51999,52000-52999,53000-53999,54000-54999,55000-55999,56000-56999,57000-57999,58000-58999,59000-59999,60000-99999|
G|216,222,225|Gibraltar|00000-99999|
M|50-59||000000-999999|
# Reference: https://www.gra.gi/uploads/documents/Communications/Numbering%20Plan/GRA%20Numbering%20Plan.pdf via https://www.gra.gi/communications/numbering-plan
# Reference Date: 11/05/2023
G|200|Gibraltar|00000-99999|
G|203|Gibraltar|00000-19999|
G|216|Gibraltar|20000-29999,40000-84999,90000-94999|
G|222|Gibraltar|20000-29999,40000-59999,70000-79999|
G|225|Gibraltar|00000-14999,50000-54999|
M|51||000000-099999|
M|52||500000-514999|
M|56-58||000000-999999|
M|60||100000-119999|
N|80||00-99|F
N|81-86,89||00-99|R
N|87||00-99|
N|86,88-89||00-99|R
N|87||00-99|S
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,25 @@ public class DefaultPhoneNumberParserTests_GI_GeographicNumber

[Theory]
[InlineData("20000000", "200", "00000", "Gibraltar")]
[InlineData("20049999", "200", "49999", "Gibraltar")]
[InlineData("20050000", "200", "50000", "Gibraltar")]
[InlineData("20050999", "200", "50999", "Gibraltar")]
[InlineData("20051000", "200", "51000", "Gibraltar")]
[InlineData("20051999", "200", "51999", "Gibraltar")]
[InlineData("20052000", "200", "52000", "Gibraltar")]
[InlineData("20052999", "200", "52999", "Gibraltar")]
[InlineData("20053000", "200", "53000", "Gibraltar")]
[InlineData("20053999", "200", "53999", "Gibraltar")]
[InlineData("20054000", "200", "54000", "Gibraltar")]
[InlineData("20054999", "200", "54999", "Gibraltar")]
[InlineData("20055000", "200", "55000", "Gibraltar")]
[InlineData("20055999", "200", "55999", "Gibraltar")]
[InlineData("20056000", "200", "56000", "Gibraltar")]
[InlineData("20056999", "200", "56999", "Gibraltar")]
[InlineData("20057000", "200", "57000", "Gibraltar")]
[InlineData("20057999", "200", "57999", "Gibraltar")]
[InlineData("20058000", "200", "58000", "Gibraltar")]
[InlineData("20058999", "200", "58999", "Gibraltar")]
[InlineData("20059000", "200", "59000", "Gibraltar")]
[InlineData("20059999", "200", "59999", "Gibraltar")]
[InlineData("20060000", "200", "60000", "Gibraltar")]
[InlineData("20099999", "200", "99999", "Gibraltar")]
[InlineData("21600000", "216", "00000", "Gibraltar")]
[InlineData("21699999", "216", "99999", "Gibraltar")]
[InlineData("22200000", "222", "00000", "Gibraltar")]
[InlineData("22299999", "222", "99999", "Gibraltar")]
[InlineData("20300000", "203", "00000", "Gibraltar")]
[InlineData("20319999", "203", "19999", "Gibraltar")]
[InlineData("21620000", "216", "20000", "Gibraltar")]
[InlineData("21629999", "216", "29999", "Gibraltar")]
[InlineData("21640000", "216", "40000", "Gibraltar")]
[InlineData("21684999", "216", "84999", "Gibraltar")]
[InlineData("21690000", "216", "90000", "Gibraltar")]
[InlineData("21694999", "216", "94999", "Gibraltar")]
[InlineData("22220000", "222", "20000", "Gibraltar")]
[InlineData("22229999", "222", "29999", "Gibraltar")]
[InlineData("22240000", "222", "40000", "Gibraltar")]
[InlineData("22259999", "222", "59999", "Gibraltar")]
[InlineData("22270000", "222", "70000", "Gibraltar")]
[InlineData("22279999", "222", "79999", "Gibraltar")]
[InlineData("22500000", "225", "00000", "Gibraltar")]
[InlineData("22599999", "225", "99999", "Gibraltar")]
[InlineData("22514999", "225", "14999", "Gibraltar")]
[InlineData("22550000", "225", "50000", "Gibraltar")]
[InlineData("22554999", "225", "54999", "Gibraltar")]
public void Parse_Known_GeographicPhoneNumber_2XX_NationalDestinationCode(string value, string NationalDestinationCode, string subscriberNumber, string geographicArea)
{
var parseResult = s_parser.Parse(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ public class DefaultPhoneNumberParserTests_GI_MobilePhoneNumber
private static readonly PhoneNumberParser s_parser = DefaultPhoneNumberParser.Create(CountryInfo.Gibraltar);

[Theory]
[InlineData("50000000", "50", "000000")]
[InlineData("50999999", "50", "999999")]
[InlineData("59000000", "59", "000000")]
[InlineData("59999999", "59", "999999")]
[InlineData("51000000", "51", "000000")]
[InlineData("51099999", "51", "099999")]
[InlineData("52500000", "52", "500000")]
[InlineData("52514999", "52", "514999")]
[InlineData("56000000", "56", "000000")]
[InlineData("56999999", "56", "999999")]
[InlineData("58000000", "58", "000000")]
[InlineData("58999999", "58", "999999")]
[InlineData("60100000", "60", "100000")]
[InlineData("60119999", "60", "119999")]
public void Parse_Known_MobilePhoneNumber(string value, string NationalDestinationCode, string subscriberNumber)
{
var parseResult = s_parser.Parse(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class DefaultPhoneNumberParserTests_GI_NonGeographicPhoneNumber
private static readonly PhoneNumberParser s_parser = DefaultPhoneNumberParser.Create(CountryInfo.Gibraltar);

[Theory]
[InlineData("8700", "87", "00")]
[InlineData("8799", "87", "99")]
public void Parse_Known_NonGeographicPhoneNumber_8X_NationalDestinationCode(string value, string NationalDestinationCode, string subscriberNumber)
[InlineData("8000", "80", "00")]
[InlineData("8099", "80", "99")]
public void Parse_Known_NonGeographicPhoneNumber_Freephone(string value, string NationalDestinationCode, string subscriberNumber)
{
var parseResult = s_parser.Parse(value);
parseResult.ThrowIfFailure();
Expand All @@ -22,7 +22,7 @@ public void Parse_Known_NonGeographicPhoneNumber_8X_NationalDestinationCode(stri

var nonGeographicPhoneNumber = (NonGeographicPhoneNumber)phoneNumber;
Assert.Equal(CountryInfo.Gibraltar, nonGeographicPhoneNumber.Country);
Assert.False(nonGeographicPhoneNumber.IsFreephone);
Assert.True(nonGeographicPhoneNumber.IsFreephone);
Assert.False(nonGeographicPhoneNumber.IsMachineToMachine);
Assert.False(nonGeographicPhoneNumber.IsPremiumRate);
Assert.False(nonGeographicPhoneNumber.IsSharedCost);
Expand All @@ -31,9 +31,13 @@ public void Parse_Known_NonGeographicPhoneNumber_8X_NationalDestinationCode(stri
}

[Theory]
[InlineData("8000", "80", "00")]
[InlineData("8099", "80", "99")]
public void Parse_Known_NonGeographicPhoneNumber_Freephone(string value, string NationalDestinationCode, string subscriberNumber)
[InlineData("8600", "86", "00")]
[InlineData("8699", "86", "99")]
[InlineData("8800", "88", "00")]
[InlineData("8899", "88", "99")]
[InlineData("8900", "89", "00")]
[InlineData("8999", "89", "99")]
public void Parse_Known_NonGeographicPhoneNumber_PremiumRate(string value, string NationalDestinationCode, string subscriberNumber)
{
var parseResult = s_parser.Parse(value);
parseResult.ThrowIfFailure();
Expand All @@ -45,22 +49,18 @@ public void Parse_Known_NonGeographicPhoneNumber_Freephone(string value, string

var nonGeographicPhoneNumber = (NonGeographicPhoneNumber)phoneNumber;
Assert.Equal(CountryInfo.Gibraltar, nonGeographicPhoneNumber.Country);
Assert.True(nonGeographicPhoneNumber.IsFreephone);
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);
}

[Theory]
[InlineData("8100", "81", "00")]
[InlineData("8199", "81", "99")]
[InlineData("8600", "86", "00")]
[InlineData("8699", "86", "99")]
[InlineData("8900", "89", "00")]
[InlineData("8999", "89", "99")]
public void Parse_Known_NonGeographicPhoneNumber_PremiumRate(string value, string NationalDestinationCode, string subscriberNumber)
[InlineData("8700", "87", "00")]
[InlineData("8799", "87", "99")]
public void Parse_Known_NonGeographicPhoneNumber_SharedCost(string value, string NationalDestinationCode, string subscriberNumber)
{
var parseResult = s_parser.Parse(value);
parseResult.ThrowIfFailure();
Expand All @@ -74,8 +74,8 @@ public void Parse_Known_NonGeographicPhoneNumber_PremiumRate(string value, strin
Assert.Equal(CountryInfo.Gibraltar, nonGeographicPhoneNumber.Country);
Assert.False(nonGeographicPhoneNumber.IsFreephone);
Assert.False(nonGeographicPhoneNumber.IsMachineToMachine);
Assert.True(nonGeographicPhoneNumber.IsPremiumRate);
Assert.False(nonGeographicPhoneNumber.IsSharedCost);
Assert.False(nonGeographicPhoneNumber.IsPremiumRate);
Assert.True(nonGeographicPhoneNumber.IsSharedCost);
Assert.Equal(NationalDestinationCode, nonGeographicPhoneNumber.NationalDestinationCode);
Assert.Equal(subscriberNumber, nonGeographicPhoneNumber.SubscriberNumber);
}
Expand Down

0 comments on commit 7642c3f

Please sign in to comment.