fix pester tests
This commit is contained in:
parent
381d0abf7d
commit
01e8a2f263
@ -80,7 +80,7 @@ Describe "New-CredentialStore" {
|
|||||||
$CS = Get-CredentialStore
|
$CS = Get-CredentialStore
|
||||||
$CS.PfxCertificate | Should -Be $null
|
$CS.PfxCertificate | Should -Be $null
|
||||||
$CS.Thumbprint | Should -Not -Be $null
|
$CS.Thumbprint | Should -Not -Be $null
|
||||||
$res = Test-CSCertificate -Thumbprint $CS.Thumbprint -StoreName My -StoreLocation CurrentUser
|
$res = Test-CSCertificate -Type Private
|
||||||
#Write-Verbose -Message ('res: {0}' -f $res) -Verbose
|
#Write-Verbose -Message ('res: {0}' -f $res) -Verbose
|
||||||
$res | Should -Be $true
|
$res | Should -Be $true
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ Describe "New-CredentialStore" {
|
|||||||
$CS = Get-CredentialStore -Shared
|
$CS = Get-CredentialStore -Shared
|
||||||
$CS.PfxCertificate | Should -Be $null
|
$CS.PfxCertificate | Should -Be $null
|
||||||
$CS.Thumbprint | Should -Not -Be $null
|
$CS.Thumbprint | Should -Not -Be $null
|
||||||
$res = Test-CSCertificate -Thumbprint $CS.Thumbprint -StoreName My -StoreLocation LocalMachine
|
$res = Test-CSCertificate -Type Shared
|
||||||
#Write-Verbose -Message ('res: {0}' -f $res) -Verbose
|
#Write-Verbose -Message ('res: {0}' -f $res) -Verbose
|
||||||
$res | Should -Be $true
|
$res | Should -Be $true
|
||||||
}
|
}
|
||||||
|
@ -13,11 +13,11 @@ Describe "Get-CredentialStore" {
|
|||||||
{ Get-CredentialStore } | Should -Not -Throw
|
{ Get-CredentialStore } | Should -Not -Throw
|
||||||
}
|
}
|
||||||
It "Test2: Read Credential Store with testing data" {
|
It "Test2: Read Credential Store with testing data" {
|
||||||
{ Use-PfxCertificate -Shared -CredentialStore $TestCredentialStore -Path $TestPfxCert } | Should -Not -Throw
|
{ Use-CSCertificate -Shared -CredentialStore $TestCredentialStore -Path $TestPfxCert } | Should -Not -Throw
|
||||||
{ Get-CredentialStore -Shared -Path $TestCredentialStore } | Should -Not -Throw
|
{ Get-CredentialStore -Shared -Path $TestCredentialStore } | Should -Not -Throw
|
||||||
}
|
}
|
||||||
It "Test3: Not existing path should return false" {
|
It "Test3: Not existing path should return false" {
|
||||||
{ Get-CredentialStore -Shared -Path './CredentialStore.json' }| Should -Throw "Could not find the CredentialStore."
|
{ Get-CredentialStore -Shared -Path './CredentialStore.json' } | Should -Throw "Could not find the CredentialStore."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Context "Testing invalid json data" {
|
Context "Testing invalid json data" {
|
||||||
|
Loading…
Reference in New Issue
Block a user