Skip to content

Commit

Permalink
New-TssSession - format date comparison for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Feb 14, 2021
1 parent bd10067 commit 7b1e998
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/functions/New-TssSession.Tests.ps1
Expand Up @@ -58,12 +58,12 @@ Describe "$commandName works" {
$sessionCredential.RefreshToken | Should -Not -BeNullOrEmpty
}
It "Calculates TimeOfDeath" {
$expectedValue = [datetime]::UtcNow.Add([timespan]::FromSeconds($expiresIn))
$sessionCredential.TimeOfDeath | Should -BeLessOrEqual $expectedValue
$expectedValue = "{0:yyyy}-{0:MM}-{0:dd} {0:hh}:{0:mm}" -f [datetime]::Now.Add([timespan]::FromSeconds($expiresIn))
"{0:yyyy}-{0:MM}-{0:dd} {0:hh}:{0:mm}" -f $sessionCredential.TimeOfDeath | Should -BeGreaterOrEqual $expectedValue
}
It "Calculates StartTime" {
$currentTime = [datetime]::UtcNow
$sessionCredential.StartTime | Should -BeLessOrEqual $currentTime
$currentTime = "{0:yyyy}-{0:MM}-{0:dd} {0:hh}:{0:mm}" -f [datetime]::Now
"{0:yyyy}-{0:MM}-{0:dd} {0:hh}:{0:mm}" -f $sessionCredential.StartTime | Should -BeGreaterOrEqual $currentTime
}
It "RefreshSession() method updates AccessToken" {
$orgAccessToken = $sessionCredential.AccessToken
Expand Down

0 comments on commit 7b1e998

Please sign in to comment.