mirror of
https://github.com/PowerShell/PSDscResources
synced 2026-06-21 13:45:29 +00:00
fixing bug in Archive unit test
This commit is contained in:
committed by
Katie Keim
parent
284692abf1
commit
94147e2b59
@@ -2095,12 +2095,14 @@ Describe 'Archive Unit Tests' {
|
||||
}
|
||||
|
||||
Describe 'Get-TimestampForChecksum' {
|
||||
Mock -CommandName 'Get-Date' -MockWith { return $Date }
|
||||
|
||||
|
||||
# This is the actual file info of this file since we cannot set the properties of mock objects
|
||||
$testFileInfo = New-Object -TypeName 'System.IO.FileInfo' -ArgumentList @( $PSScriptRoot )
|
||||
$testFileCreationTime = $testFileInfo.CreationTime.DateTime
|
||||
$testFileLastWriteTime = $testFileInfo.LastWriteTime.DateTime
|
||||
$testFileCreationTime = (Get-Date -Date $testFileInfo.CreationTime.DateTime -Format 'G')
|
||||
$testFileLastWriteTime = (Get-Date -Date $testFileInfo.LastWriteTime.DateTime -Format 'G')
|
||||
|
||||
Mock -CommandName 'Get-Date' -MockWith { return $testFileCreationTime }
|
||||
|
||||
Context 'Checksum specified as CreatedDate' {
|
||||
$getTimestampForChecksumParameters = @{
|
||||
@@ -2128,6 +2130,8 @@ Describe 'Archive Unit Tests' {
|
||||
}
|
||||
}
|
||||
|
||||
Mock -CommandName 'Get-Date' -MockWith { return $testFileLastWriteTime }
|
||||
|
||||
Context 'Checksum specified as ModifiedDate' {
|
||||
$getTimestampForChecksumParameters = @{
|
||||
File = $testFileInfo
|
||||
|
||||
Reference in New Issue
Block a user