From f4e61d0445d11c1a7096fd099f3ec8190f48225f Mon Sep 17 00:00:00 2001 From: Jo-Be-Co Date: Fri, 10 Apr 2026 11:44:28 +0200 Subject: [PATCH] hardend an commented unit tests for region output --- .../TemplatesTests.cs | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs b/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs index 4cf0d0eb..68106541 100644 --- a/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs +++ b/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs @@ -808,35 +808,39 @@ namespace TemplatesTests } [TestMethod] + // Audible does not provide a consistent or authoritative region code for its storefronts. + // In most cases, the storefront region can be inferred from the EnglishName of a matching RegionInfo entry. However, + // the US and UK storefronts do not follow this pattern, and the three historical “pre‑Amazon” storefront identifiers require + // separate interpretation to remain globally usable for all users. + // To ensure robustness, the tests attempt to cover all known Audible storefronts explicitly. + + // Skipping of NativeName: its output is influenced by external standards bodies and evolving globalization data (NLS vs. ICU), + // not solely by the OSPlatform. + // Because .NET provides no stability guarantees for NativeName across platforms or ICU/NLS versions, we do not include + // platform-specific tests here—unlike path-related differences, which are defined and testable. + // test known locales [DataRow("us", "", "ID:US, 2:US, 3:USA, W:USA, D:Estados Unidos, E:United States, N:United States, O:us")] [DataRow("uk", "", "ID:GB, 2:GB, 3:GBR, W:GBR, D:Reino Unido, E:United Kingdom, N:United Kingdom, O:uk")] - // Skip NativeName: on Linux/ICU the native name for Canada is returned as the Inuktitut form 'ᑲᓇᑕ', while Windows returns 'Canada'. - // Because this value depends on the OS/globalization provider, it cannot be used for stable cross-platform tests. - [DataRow("canada", "", - "ID:CA, 2:CA, 3:CAN, W:CAN, D:Canadá, E:Canada, N:---, O:canada")] [DataRow("germany", "", "ID:DE, 2:DE, 3:DEU, W:DEU, D:Alemania, E:Germany, N:Deutschland, O:germany")] - [DataRow("france", "", - "ID:FR, 2:FR, 3:FRA, W:FRA, D:Francia, E:France, N:Frañs, O:france")] - [DataRow("australia", "", - "ID:AU, 2:AU, 3:AUS, W:AUS, D:Australia, E:Australia, N:Australia, O:australia")] - [DataRow("japan", "", - "ID:JP, 2:JP, 3:JPN, W:JPN, D:Japón, E:Japan, N:日本, O:japan")] - [DataRow("india", "", - "ID:IN, 2:IN, 3:IND, W:IND, D:India, E:India, N:ভাৰত, O:india")] - [DataRow("spain", "", - "ID:ES, 2:ES, 3:ESP, W:ESP, D:España, E:Spain, N:España, O:spain")] - [DataRow("italy", "", - "ID:IT, 2:IT, 3:ITA, W:ITA, D:Italia, E:Italy, N:Itàlia, O:italy")] - [DataRow("brazil", "", - "ID:BR, 2:BR, 3:BRA, W:BRA, D:Brasil, E:Brazil, N:Brasil, O:brazil")] + // Skip NativeName (see above) + [DataRow("france", "", "ID:FR, 2:FR, 3:FRA, W:FRA, D:Francia, E:France, O:france")] + [DataRow("australia", "", "ID:AU, 2:AU, 3:AUS, W:AUS, D:Australia, E:Australia, O:australia")] + [DataRow("india", "", "ID:IN, 2:IN, 3:IND, W:IND, D:India, E:India, O:india")] + [DataRow("spain", "", "ID:ES, 2:ES, 3:ESP, W:ESP, D:España, E:Spain, O:spain")] + [DataRow("italy", "", "ID:IT, 2:IT, 3:ITA, W:ITA, D:Italia, E:Italy, O:italy")] + [DataRow("canada", "", "ID:CA, 2:CA, 3:CAN, W:CAN, D:Canadá, E:Canada, O:canada")] + [DataRow("japan", "", "ID:JP, 2:JP, 3:JPN, W:JPN, D:Japón, E:Japan, O:japan")] + [DataRow("brazil", "", "ID:BR, 2:BR, 3:BRA, W:BRA, D:Brasil, E:Brazil, O:brazil")] + // test historical locales [DataRow("pre-amazon - us", "", "ID:US, O:pre-amazon - us")] [DataRow("pre-amazon - uk", "", "ID:GB, O:pre-amazon - uk")] [DataRow("pre-amazon - germany", "", "ID:DE, O:pre-amazon - germany")] + // test upcoming locales [DataRow("be", "", "ID:BE, E:Belgium, O:be")] [DataRow("nl", "", "ID:NL, E:Netherlands, O:nl")] @@ -845,13 +849,15 @@ namespace TemplatesTests [DataRow("ie", "", "ID:IE, E:Ireland, O:ie")] [DataRow("sg", "", "ID:SG, E:Singapore, O:sg")] [DataRow("za", "", "ID:ZA, E:South Africa, O:za")] - // Skip EnglishName: the official English name of Turkey changed to 'Türkiye', and the returned value now depends on - // the OS/globalization provider (Windows-NLS vs. ICU). Tests would not be stable. - [DataRow("tr", "", "ID:TR, E:---, O:tr")] [DataRow("ae", "", "ID:AE, E:United Arab Emirates, O:ae")] [DataRow("sa", "", "ID:SA, E:Saudi Arabia, O:sa")] [DataRow("eg", "", "ID:EG, E:Egypt, O:eg")] - // different localizations + // Skip EnglishName: the official English name of Turkey changed to 'Türkiye', and the returned value now depends on + // the OS/globalization provider (Windows-NLS vs. ICU). Tests would not be stable. + // A future lookup may still need to account for whichever English name Audible chooses to use. + [DataRow("tr", "", "ID:TR, E:---, O:tr")] + + // test some different localizations - should change only D(isplayNames) [DataRow("fr", "", "D:Frankreich, E:France, N:France, O:fr")] [DataRow("fr", "", "D:Francja")] [DataRow("fr", "", "D:Francia")]