hardend an commented unit tests for region output

This commit is contained in:
Jo-Be-Co
2026-04-10 11:44:28 +02:00
parent 54765fc181
commit f4e61d0445

View File

@@ -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 “preAmazon” 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", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:US, 2:US, 3:USA, W:USA, D:Estados Unidos, E:United States, N:United States, O:us")]
[DataRow("uk", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"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", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:---, O:{O}]>",
"ID:CA, 2:CA, 3:CAN, W:CAN, D:Canadá, E:Canada, N:---, O:canada")]
[DataRow("germany", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:DE, 2:DE, 3:DEU, W:DEU, D:Alemania, E:Germany, N:Deutschland, O:germany")]
[DataRow("france", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:FR, 2:FR, 3:FRA, W:FRA, D:Francia, E:France, N:Frañs, O:france")]
[DataRow("australia", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:AU, 2:AU, 3:AUS, W:AUS, D:Australia, E:Australia, N:Australia, O:australia")]
[DataRow("japan", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:JP, 2:JP, 3:JPN, W:JPN, D:Japón, E:Japan, N:日本, O:japan")]
[DataRow("india", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:IN, 2:IN, 3:IND, W:IND, D:India, E:India, N:ভাৰত, O:india")]
[DataRow("spain", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:ES, 2:ES, 3:ESP, W:ESP, D:España, E:Spain, N:España, O:spain")]
[DataRow("italy", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:IT, 2:IT, 3:ITA, W:ITA, D:Italia, E:Italy, N:Itàlia, O:italy")]
[DataRow("brazil", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, N:{N}, O:{O}]>",
"ID:BR, 2:BR, 3:BRA, W:BRA, D:Brasil, E:Brazil, N:Brasil, O:brazil")]
// Skip NativeName (see above)
[DataRow("france", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:FR, 2:FR, 3:FRA, W:FRA, D:Francia, E:France, O:france")]
[DataRow("australia", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:AU, 2:AU, 3:AUS, W:AUS, D:Australia, E:Australia, O:australia")]
[DataRow("india", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:IN, 2:IN, 3:IND, W:IND, D:India, E:India, O:india")]
[DataRow("spain", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:ES, 2:ES, 3:ESP, W:ESP, D:España, E:Spain, O:spain")]
[DataRow("italy", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:IT, 2:IT, 3:ITA, W:ITA, D:Italia, E:Italy, O:italy")]
[DataRow("canada", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:CA, 2:CA, 3:CAN, W:CAN, D:Canadá, E:Canada, O:canada")]
[DataRow("japan", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:JP, 2:JP, 3:JPN, W:JPN, D:Japón, E:Japan, O:japan")]
[DataRow("brazil", "<locale[ID:{ID}, 2:{I}, 3:{I3}, W:{W}, D:{D}, E:{E}, O:{O}]>", "ID:BR, 2:BR, 3:BRA, W:BRA, D:Brasil, E:Brazil, O:brazil")]
// test historical locales
[DataRow("pre-amazon - us", "<locale[ID:{ID}, O:{O}]>", "ID:US, O:pre-amazon - us")]
[DataRow("pre-amazon - uk", "<locale[ID:{ID}, O:{O}]>", "ID:GB, O:pre-amazon - uk")]
[DataRow("pre-amazon - germany", "<locale[ID:{ID}, O:{O}]>", "ID:DE, O:pre-amazon - germany")]
// test upcoming locales
[DataRow("be", "<locale[ID:{ID}, E:{E}, O:{O}]>", "ID:BE, E:Belgium, O:be")]
[DataRow("nl", "<locale[ID:{ID}, E:{E}, O:{O}]>", "ID:NL, E:Netherlands, O:nl")]
@@ -845,13 +849,15 @@ namespace TemplatesTests
[DataRow("ie", "<locale[ID:{ID}, E:{E}, O:{O}]>", "ID:IE, E:Ireland, O:ie")]
[DataRow("sg", "<locale[ID:{ID}, E:{E}, O:{O}]>", "ID:SG, E:Singapore, O:sg")]
[DataRow("za", "<locale[ID:{ID}, E:{E}, O:{O}]>", "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", "<locale[ID:{ID}, E:---, O:{O}]>", "ID:TR, E:---, O:tr")]
[DataRow("ae", "<locale[ID:{ID}, E:{E}, O:{O}]>", "ID:AE, E:United Arab Emirates, O:ae")]
[DataRow("sa", "<locale[ID:{ID}, E:{E}, O:{O}]>", "ID:SA, E:Saudi Arabia, O:sa")]
[DataRow("eg", "<locale[ID:{ID}, E:{E}, O:{O}]>", "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", "<locale[ID:{ID}, E:---, O:{O}]>", "ID:TR, E:---, O:tr")]
// test some different localizations - should change only D(isplayNames)
[DataRow("fr", "<locale[D:{D@de-DE}, E:{E@de-DE}, N:{N@de-DE}, O:{O@de-DE}]>", "D:Frankreich, E:France, N:France, O:fr")]
[DataRow("fr", "<locale[D:{D@pl}]>", "D:Francja")]
[DataRow("fr", "<locale[D:{D@it}]>", "D:Francia")]