Files
PowerShell-PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1
T
James Truher 1e1c4b7dc0 Restructure of pester test layout
This restructuring moves tests to a directory name which matches the module
in which the cmdlet resides which should improve the discoverability of a
specific test.
For tests which are not about cmdlets in a module, new directories have been
created to make those tests easier to find as well
2016-06-29 12:05:41 -07:00

36 lines
1.1 KiB
PowerShell

$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
Describe "Import-LocalizedData" {
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
}
}