forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImport-LocalizedData.Tests.ps1
More file actions
35 lines (27 loc) · 1.13 KB
/
Copy pathImport-LocalizedData.Tests.ps1
File metadata and controls
35 lines (27 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
Describe "Import-LocalizedData" -Tags "CI" {
BeforeAll {
$script = "localized.ps1"
$sunday = "Sunday"
$sundayInGerman = $sunday + " (in German)"
}
It "Should be able to import string using default culture" {
# Set-Culture is broken, but let's verify that default culture is en-US
$culture = Get-Culture
$culture.Name | Should Be "en-US"
$d = Import-LocalizedData -FileName $script -BaseDirectory $assetsDir
$d.d0 | Should be $sunday
}
It "Should be able to import string using en-US culture" {
$d = Import-LocalizedData -FileName $script -BaseDirectory $assetsDir -UICulture en-US
$d.d0 | Should be $sunday
}
It "Should be able to import string using de-DE culture" {
$d = Import-LocalizedData -FileName $script -BaseDirectory $assetsDir -UICulture de-DE
$d.d0 | Should be $sundayInGerman
}
It "Should be able to import string and store in binding variable" {
Import-LocalizedData -FileName $script -BaseDirectory $assetsDir -UICulture de-DE -BindingVariable d
$d.d0 | Should be $sundayInGerman
}
}