Improve Unit Test for Get-Date

This commit is contained in:
TingLiu6
2016-04-07 00:15:50 -07:00
parent 9733f5e8e7
commit 63f8782d05
+4 -4
View File
@@ -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" {