Skip to content

Commit

Permalink
C#: use Java locale information and fix the geocoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Mezard committed Oct 19, 2011
1 parent 2a39e7e commit b81de60
Show file tree
Hide file tree
Showing 7 changed files with 47,277 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
^csharp/PhoneNumbers.Test/bin/
~$
csharp/lib/Phonenumber.cs
csharp/lib/Phonemetadata.cs
csharp/lib/Phonemetadata.cs
csharp/lib/DumpLocale.class
6 changes: 1 addition & 5 deletions csharp/PhoneNumbers.Test/TestPhoneNumberOfflineGeocoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public void SetupFixture()
geocoder = new PhoneNumberOfflineGeocoder(TEST_MAPPING_DATA_DIRECTORY);
}

/* This test is disabled as we do not have localized country names by
* default on .NET. Also, Bahamas RegionInfo does not exist.
[Test]
public void testGetDescriptionForNumberWithNoDataFile()
{
Expand All @@ -82,7 +80,6 @@ public void testGetDescriptionForNumberWithNoDataFile()
Assert.AreEqual("", geocoder.GetDescriptionForNumber(NUMBER_WITH_INVALID_COUNTRY_CODE,
new Locale("en", "US")));
}
*/

[Test]
public void testGetDescriptionForNumberWithMissingPrefix()
Expand Down Expand Up @@ -133,8 +130,7 @@ public void TestGetDescriptionForFallBack()
Assert.AreEqual("CA",
geocoder.GetDescriptionForNumber(US_NUMBER1, Locale.ITALIAN));
// Korean doesn't fall back to English.
// C#: changed from Java because we lack korean locale information
Assert.AreEqual("Korea",
Assert.AreEqual("\uB300\uD55C\uBBFC\uAD6D",
geocoder.GetDescriptionForNumber(KO_NUMBER3, Locale.KOREAN));
}

Expand Down
Loading

0 comments on commit b81de60

Please sign in to comment.