You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It 'Should use the localized string key <LocalizedKey>, from the localization resource file'-TestCases $testCases_LocalizedKeys-Skip:$skipTest_LocalizedKeys {
1392
+
It 'Should use the localized string key <LocalizedKey> from the localization resource file'-TestCases $testCases_LocalizedKeys-Skip:$skipTest_LocalizedKeys {
1393
1393
param
1394
1394
(
1395
1395
[Parameter()]
1396
1396
[System.String]
1397
1397
$LocalizedKey
1398
1398
)
1399
1399
1400
-
$usedLocalizationKeys| Should -Contain $LocalizedKey-Because 'the key exist in the localized string resource file'
1400
+
$usedLocalizationKeys| Should -Contain $LocalizedKey-Because 'the key exists in the localized string resource file so it should also exist in the code'
1401
1401
}
1402
1402
1403
-
It 'Should not be missing the localized string key <LocalizedKey>, in the localization resource file'-TestCases $testCases_UsedLocalizedKeys-Skip:$skipTest_UsedLocalizedKeys {
1403
+
It 'Should not be missing the localized string key <LocalizedKey> from the localization resource file'-TestCases $testCases_UsedLocalizedKeys-Skip:$skipTest_UsedLocalizedKeys {
1404
1404
param
1405
1405
(
1406
1406
[Parameter()]
1407
1407
[System.String]
1408
1408
$LocalizedKey
1409
1409
)
1410
1410
1411
-
$englishLocalizedStrings.Keys| Should -Contain $LocalizedKey-Because 'the key is used in the resource/module script file'
1411
+
$englishLocalizedStrings.Keys| Should -Contain $LocalizedKey-Because 'the key is used in the resource/module script file so it should also exist in the localized string resource files'
1412
1412
}
1413
1413
}
1414
1414
}
1415
1415
}
1416
1416
1417
1417
Context 'When a resource or module is localized to other languages' {
# Only run these tests if there are test cases to be tested.
1444
-
if ($testCases)
1445
-
{
1446
-
$skipTests=$false
1447
-
}
1448
-
else
1449
-
{
1450
-
$skipTests=$true
1451
-
}
1444
+
$skipTests=-not$otherLanguagesToTest
1452
1445
1453
-
It 'Should have localization string resource file for the resource/module <Folder> and localization folder <LocalizationFolder>'-TestCases $testCases-Skip:$skipTests {
1446
+
It 'Should have a localization string resource file for the resource/module <Folder> and localization folder <LocalizationFolder>'-TestCases $otherLanguagesToTest-Skip:$skipTests {
Test-Path-Path $localizationResourceFilePath| Should -BeTrue -Because ('the there must exist a string resource file in the localization folder {0}'-f$LocalizationFolder)
1464
+
Test-Path-Path $localizationResourceFilePath| Should -BeTrue -Because ('there must exist a string resource file in the localization folder {0}'-f$LocalizationFolder)
1472
1465
}
1473
1466
1474
-
It 'Should have the localization folder with the correct casing for the resource/module <Folder> and localization folder <LocalizationFolder>'-TestCases $testCases-Skip:$skipTests {
1467
+
It 'Should have a localization folder with the correct casing for the resource/module <Folder> and localization folder <LocalizationFolder>'-TestCases $otherLanguagesToTest-Skip:$skipTests {
$localizedStrings.Keys| Should -Contain $LocalizedKey-Because 'the key exist in the en-US localization resource file'
1541
+
$localizedStrings.Keys| Should -Contain $LocalizedKey-Because 'the key exists in the en-US localization resource file so the key should also exist in this language file'
1549
1542
} -ErrorVariable itBlockError
1550
1543
1551
-
# If the It-block did not pass the test, output the a text explaining hwo to resolve the issue.
1544
+
<#
1545
+
If the It-block did not pass the test, output the a text
1546
+
explaining how to resolve the issue.
1547
+
#>
1552
1548
if ($itBlockError.Count-ne0)
1553
1549
{
1554
1550
$message=@"
@@ -1561,7 +1557,7 @@ with the en-US text string.
1561
1557
Write-Host-ForegroundColor White -Object ''
1562
1558
}
1563
1559
1564
-
It "Should not be missing the localization string key <LocalizedKey> in the english resource file for the resource/module <Folder>"-TestCases $testCases_MissingEnglishLocalizedKeys {
1560
+
It "Should not be missing the localization string key <LocalizedKey> from the english resource file for the resource/module <Folder>"-TestCases $testCases_MissingEnglishLocalizedKeys {
1565
1561
param
1566
1562
(
1567
1563
[Parameter()]
@@ -1577,7 +1573,7 @@ with the en-US text string.
1577
1573
$LocalizationFolder
1578
1574
)
1579
1575
1580
-
$englishLocalizedStrings.Keys| Should -Contain $LocalizedKey-Because ('the key exist in the resource file for the location folder {0}'-f$LocalizationFolder)
1576
+
$englishLocalizedStrings.Keys| Should -Contain $LocalizedKey-Because ('the key exists in the resource file for the location folder {0} so it should also exist in the en-US string resource file'-f$LocalizationFolder)
0 commit comments