mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files. Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks. Separate PR coming to update contribution document for new source files: #6140 Manually reviewed each change. Fix #6073
38 lines
1.2 KiB
PowerShell
38 lines
1.2 KiB
PowerShell
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
$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
|
|
}
|
|
|
|
}
|