Fix the failure in RegionInfo Tests (dotnet/corefx#38577)
authorTarek Mahmoud Sayed <tarekms@microsoft.com>
Sun, 16 Jun 2019 19:38:38 +0000 (20:38 +0100)
committerViktor Hofer <viktor.hofer@microsoft.com>
Sun, 16 Jun 2019 19:38:38 +0000 (21:38 +0200)
* Fix the failure in RegionInfo Tests

China region name has changed to "China mainland", we are updating the test to accept this new name too.

Commit migrated from https://github.com/dotnet/corefx/commit/d3b6b4aff1dd10afdc83ecfd01ee462737693077

src/libraries/System.Globalization/tests/System/Globalization/RegionInfoTests.cs

index 9586135..cb6e48e 100644 (file)
@@ -91,12 +91,12 @@ namespace System.Globalization.Tests
         [Theory]
         [InlineData("en-US", new string[] { "United States" })]
         [InlineData("US", new string[] { "United States" })]
-        [InlineData("zh-CN", new string[] { "China", "People's Republic of China" })]
-        [InlineData("CN", new string[] { "China", "People's Republic of China" })]
+        [InlineData("zh-CN", new string[] { "China", "People's Republic of China", "China mainland" })]
+        [InlineData("CN", new string[] { "China", "People's Republic of China", "China mainland" })]
         public void EnglishName(string name, string[] expected)
         {
             string result = new RegionInfo(name).EnglishName;
-            Assert.True(expected.Contains(result));
+            Assert.True(expected.Contains(result), $"RegionInfo.EnglishName({name})='{result}' not found in the possible names ({String.Join(", ", expected)}) ");
         }
 
         [Theory]