/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1
47 строк
1 KB
Steve Lee
Update copyright notice to latest guidance (#12190)
24 мар 2020, 21:08
Не верифицирован
24 мар 2020, 21:08
b7cb335
Код
Авторство
О чём код?
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "GetDateFormatUpdates" -Tags "Feature" { It "Verifies that FileDate format works" { $date = Get-Date $expectedFormat = "{0:yyyyMMdd}" -f $date $actualFormat = Get-Date -Date $date -Format FileDate $actualFormat | Should -Be $expectedFormat } It "Verifies that FileDateUniversal format works" { $date = (Get-Date).ToUniversalTime() $expectedFormat = "{0:yyyyMMddZ}" -f $date $actualFormat = Get-Date -Date $date -Format FileDateUniversal $actualFormat | Should -Be $expectedFormat } It "Verifies that FileDateTime format works" { $date = Get-Date $expectedFormat = "{0:yyyyMMddTHHmmssffff}" -f $date $actualFormat = Get-Date -Date $date -Format FileDateTime $actualFormat | Should -Be $expectedFormat } It "Verifies that FileDateTimeUniversal format works" { $date = (Get-Date).ToUniversalTime() $expectedFormat = "{0:yyyyMMddTHHmmssffffZ}" -f $date $actualFormat = Get-Date -Date $date -Format FileDateTimeUniversal $actualFormat | Should -Be $expectedFormat } } Describe "GetRandomMiscTests" -Tags "Feature" { It "Shouldn't overflow when using max range" { $hadError = $false ## Don't actually need to validate { Get-Random -Minimum ([Int32]::MinValue) -Maximum ([Int32]::MaxValue) -ErrorAction Stop } | Should -Not -Throw } }