mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Improve Unit Test for Get-Date
This commit is contained in:
@@ -13,7 +13,8 @@ Describe "Get-Date DRT Unit Tests" -Tags DRT {
|
||||
}
|
||||
|
||||
It "using -displayhint produces the correct output" {
|
||||
Get-date -Date:"Jan 1, 2020" -DisplayHint:$([Microsoft.PowerShell.Commands.DisplayHintType]::Date) | Out-String | Should be "`nWednesday, January 1, 2020`n`n`n"
|
||||
$newLine = [Environment]::NewLine
|
||||
Get-date -Date:"Jan 1, 2020" -DisplayHint:$([Microsoft.PowerShell.Commands.DisplayHintType]::Date) | Out-String | Should be $newLine"Wednesday, January 1, 2020$newLine$newLine$newLine"
|
||||
}
|
||||
|
||||
It "using -format produces the correct output" {
|
||||
@@ -32,9 +33,8 @@ Describe "Get-Date DRT Unit Tests" -Tags DRT {
|
||||
Get-date -Date 1/1/0030 -uformat %a%A%b%B%c%C%d%D%e%h%H%I%j%m%M%p%r | Should be "TueTuesdayJanJanuaryTue Jan 1 00:00:00 003000101/01/30 1Jan001210100AM12:00:00 AM"
|
||||
}
|
||||
|
||||
It "using -uformat 'StTuUVwWxXyYZ' produces the correct output" {
|
||||
#ToDo
|
||||
Get-date -Date 1/1/0030 -uformat %S%T%u%U%V%w%W%x%X%y%Y%Z%% | Should be "0000:00:002012001/01/3000:00:00300030-07%"
|
||||
It "using -uformat 'StTuUVwWxXyYZ' produces the correct output" {
|
||||
Get-date -Date 1/1/0030 -uformat %S%T%u%U%V%w%W%x%X%y%Y%% | Should be "0000:00:002012001/01/3000:00:00300030%"
|
||||
}
|
||||
|
||||
It "Get-date works with pipeline input" {
|
||||
|
||||
Reference in New Issue
Block a user