Skip to content

Commit

Permalink
Closes #656
Browse files Browse the repository at this point in the history
Update Belarus numbers
  • Loading branch information
TrevorPilley committed May 29, 2024
1 parent 79c8f14 commit a3f074c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/PhoneNumbers/DataFiles/BY.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Reference: https://www.beltelecom.by/en/private/telephony/phone-codes
# Reference Date: 04/2024
G|152|Grodno|000000-999999|
G|1511|Berestovitsa|00000-99999|
G|1512|Volkovysk|00000-99999|
G|1513|Svisloch|00000-99999|
G|1514|Shchuchin|00000-99999|
G|1515|Mosty|00000-99999|
G|152|Grodno|000000-999999|
G|154|Lida|000000-999999|
G|1562|Slonim|00000-99999|
G|1563|Dyatlovo|00000-99999|
Expand All @@ -16,7 +18,7 @@ G|1595|Ivye|00000-99999|
G|1596|Korelichi|00000-99999|
G|1597|Novogrudok|00000-99999|
G|162|Brest|000000-999999|
G|163|Baranovichi|000000-999999|
G|163|Baranovichi|000000-099999|
G|1631|Kamenets|00000-99999|
G|1632|Pruzhany|00000-99999|
G|1633|Lyakhovichi|00000-99999|
Expand All @@ -26,7 +28,7 @@ G|1643|Bereza|00000-99999|
G|1644|Drogichin|00000-99999|
G|1645|Ivatsevichi|00000-99999|
G|1646|Gantsevichi|00000-99999|
G|1647|Lu9ts|00000-99999|
G|1647|Luninets|00000-99999|
G|165|Pinsk|000000-999999|
G|1651|Malorita|00000-99999|
G|1652|Ivanovo|00000-99999|
Expand Down Expand Up @@ -74,6 +76,7 @@ G|2156|Glubokoye|00000-99999|
G|2157|Dokshitsy|00000-99999|
G|2158|Ushachi|00000-99999|
G|2159|Rossony|00000-99999|
G|216|Orsha|000000-999999|
G|222|Mogilev|000000-999999|
G|2230|Gluzsk|00000-99999|
G|2231|Byhov|00000-99999|
Expand Down Expand Up @@ -116,6 +119,7 @@ G|2355|Narovlya|00000-99999|
G|2356|Lelchitsy|00000-99999|
G|2357|Oktyabrskiy|00000-99999|
G|236|Mozyr|000000-999999|
N|24||0000000-9999999|
M|25||5000000-7999999,9000000-9999999|
M|29||1000000-3999999,5000000-9999999|
M|33,44||0000000-9999999|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void Parse_Known_GeographicPhoneNumber_1X_NationalDestinationCode(string
[InlineData("8162000000", "162", "000000", "Brest")]
[InlineData("8162999999", "162", "999999", "Brest")]
[InlineData("8163000000", "163", "000000", "Baranovichi")]
[InlineData("8163999999", "163", "999999", "Baranovichi")]
[InlineData("8163099999", "163", "099999", "Baranovichi")]
[InlineData("8165000000", "165", "000000", "Pinsk")]
[InlineData("8165999999", "165", "999999", "Pinsk")]
[InlineData("8174000000", "174", "000000", "Soligorsk")]
Expand Down Expand Up @@ -112,8 +112,8 @@ public void Parse_Known_GeographicPhoneNumber_1XX_NationalDestinationCode(string
[InlineData("8164599999", "1645", "99999", "Ivatsevichi")]
[InlineData("8164600000", "1646", "00000", "Gantsevichi")]
[InlineData("8164699999", "1646", "99999", "Gantsevichi")]
[InlineData("8164700000", "1647", "00000", "Lu9ts")]
[InlineData("8164799999", "1647", "99999", "Lu9ts")]
[InlineData("8164700000", "1647", "00000", "Luninets")]
[InlineData("8164799999", "1647", "99999", "Luninets")]
[InlineData("8165100000", "1651", "00000", "Malorita")]
[InlineData("8165199999", "1651", "99999", "Malorita")]
[InlineData("8165200000", "1652", "00000", "Ivanovo")]
Expand Down Expand Up @@ -180,6 +180,8 @@ public void Parse_Known_GeographicPhoneNumber_1XXX_NationalDestinationCode(strin
[InlineData("8212999999", "212", "999999", "Vitebsk")]
[InlineData("8214000000", "214", "000000", "Polotsk")]
[InlineData("8214999999", "214", "999999", "Polotsk")]
[InlineData("8216000000", "216", "000000", "Orsha")]
[InlineData("8216999999", "216", "999999", "Orsha")]
[InlineData("8222000000", "222", "000000", "Mogilev")]
[InlineData("8222999999", "222", "999999", "Mogilev")]
[InlineData("8225000000", "225", "000000", "Bobruysk")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ public class DefaultPhoneNumberParserTests_BY_NonGeographicPhoneNumber
{
private static readonly PhoneNumberParser s_parser = DefaultPhoneNumberParser.Create(CountryInfo.Belarus);

[Theory]
[InlineData("8240000000", "24", "0000000")]
[InlineData("8249999999", "24", "9999999")]
public void Parse_Known_NonGeographicPhoneNumber_2X_NationalDestinationCode(string value, string NationalDestinationCode, string subscriberNumber)
{
var parseResult = s_parser.Parse(value);
parseResult.ThrowIfFailure();

var phoneNumber = parseResult.PhoneNumber;

Assert.NotNull(phoneNumber);
Assert.IsType<NonGeographicPhoneNumber>(phoneNumber);

var nonGeographicPhoneNumber = (NonGeographicPhoneNumber)phoneNumber;
Assert.Equal(CountryInfo.Belarus, 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("8602000000", "602", "000000")]
[InlineData("8602999999", "602", "999999")]
Expand Down

0 comments on commit a3f074c

Please sign in to comment.