Files

37 lines
1.2 KiB
PowerShell
Raw Permalink Normal View History

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
2016-02-10 16:02:28 -08:00
2016-07-25 14:01:41 -07:00
Describe "Import-LocalizedData" -Tags "CI" {
2016-02-10 16:02:28 -08:00
BeforeAll {
$script = "localized.ps1"
$sunday = "Sunday"
$sundayInGerman = $sunday + " (in German)"
2016-02-10 16:02:28 -08:00
}
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 -BeExactly "en-US"
2016-02-10 16:02:28 -08:00
$d = Import-LocalizedData -FileName $script -BaseDirectory $assetsDir
$d.d0 | Should -Be $sunday
}
2016-02-10 16:02:28 -08:00
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
}
2016-02-10 16:02:28 -08:00
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
}
2016-02-10 16:02:28 -08:00
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
}
2016-02-10 16:02:28 -08:00
}