Skip to content

Commit

Permalink
rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
twcclegg committed Aug 8, 2022
1 parent 88363cd commit ff0027f
Show file tree
Hide file tree
Showing 5 changed files with 51,719 additions and 47,709 deletions.
7 changes: 6 additions & 1 deletion csharp/PhoneNumbers.Test/TestPhoneNumberUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,10 @@ public void TestParseNationalNumber()
{
// National prefix attached.
Assert.Equal(NZNumber, phoneUtil.Parse("033316005", RegionCode.NZ));
// Some fields are not filled in by parse, but only by parseAndKeepRawInput.
Assert.False(NZNumber.HasCountryCodeSource);
Assert.Equal(PhoneNumber.Types.CountryCodeSource.UNSPECIFIED, NZNumber.CountryCodeSource);

Assert.Equal(NZNumber, phoneUtil.Parse("33316005", RegionCode.NZ));
// National prefix attached and some formatting present.
Assert.Equal(NZNumber, phoneUtil.Parse("03-331 6005", RegionCode.NZ));
Expand All @@ -1732,7 +1736,8 @@ public void TestParseNationalNumber()
Assert.Equal(NZNumber, phoneUtil.Parse("tel:03-331-6005;phone-context=+64", RegionCode.NZ));
Assert.Equal(NZNumber, phoneUtil.Parse("tel:331-6005;phone-context=+64-3", RegionCode.NZ));
Assert.Equal(NZNumber, phoneUtil.Parse("tel:331-6005;phone-context=+64-3", RegionCode.US));

Assert.Equal(NZNumber, phoneUtil.Parse(
"My number is tel:03-331-6005;phone-context=+64", RegionCode.NZ));
// Test parsing RFC3966 format with optional user-defined parameters. The parameters will appear
// after the context if present.
Assert.Equal(NZNumber, phoneUtil.Parse("tel:03-331-6005;phone-context=+64;a=%A1",
Expand Down
Loading

0 comments on commit ff0027f

Please sign in to comment.