wip
This commit is contained in:
parent
642af42d7e
commit
d34b5744fc
@ -13,16 +13,16 @@ BeforeAll {
|
|||||||
|
|
||||||
Describe "Test-CredentialStore" {
|
Describe "Test-CredentialStore" {
|
||||||
Context "Basic logic tests" {
|
Context "Basic logic tests" {
|
||||||
It "Test1: Should Not Throw" {
|
It "Should Not Throw" {
|
||||||
$TestCredentialStore = './resources/cs/CredentialStore.json'
|
$TestCredentialStore = './resources/cs/CredentialStore.json'
|
||||||
{ Test-CredentialStore -Shared -Path $TestCredentialStore } | Should -Not -Throw
|
{ Test-CredentialStore -Shared -Path $TestCredentialStore } | Should -Not -Throw
|
||||||
}
|
}
|
||||||
It "Test2: Read valid CredentialStore" {
|
It "Read valid CredentialStore" {
|
||||||
$TestCredentialStore = './resources/cs/CredentialStore.json'
|
$TestCredentialStore = './resources/cs/CredentialStore.json'
|
||||||
$res = Test-CredentialStore -Shared -Path $TestCredentialStore
|
$res = Test-CredentialStore -Shared -Path $TestCredentialStore
|
||||||
$res | Should -Be $true
|
$res | Should -Be $true
|
||||||
}
|
}
|
||||||
It "Test3: Read a broken CredentialStore" {
|
It "Read a broken CredentialStore" -Skip {
|
||||||
$BrokenCS = './resources/cs/Broken_CS.json'
|
$BrokenCS = './resources/cs/Broken_CS.json'
|
||||||
$oWarningPreference = $WarningPreference
|
$oWarningPreference = $WarningPreference
|
||||||
$WarningPreference = 'SilentlyContinue'
|
$WarningPreference = 'SilentlyContinue'
|
||||||
@ -30,7 +30,7 @@ Describe "Test-CredentialStore" {
|
|||||||
$res | Should -Be $false
|
$res | Should -Be $false
|
||||||
$WarningPreference = $oWarningPreference
|
$WarningPreference = $oWarningPreference
|
||||||
}
|
}
|
||||||
It "Test4: Not existing path should return false" {
|
It "Not existing path should return false" {
|
||||||
if ($isWindows -or ($PSVersionTable.PSVersion.Major -eq 5)) {
|
if ($isWindows -or ($PSVersionTable.PSVersion.Major -eq 5)) {
|
||||||
Test-CredentialStore -Shared -Path 'C:\foobar\CredentialStore.json' | Should -Be $false
|
Test-CredentialStore -Shared -Path 'C:\foobar\CredentialStore.json' | Should -Be $false
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@ Describe "Test-CredentialStore" {
|
|||||||
Test-CredentialStore -Shared -Path '/var/opt/foo.json' | Should -Be $false
|
Test-CredentialStore -Shared -Path '/var/opt/foo.json' | Should -Be $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
It "Test5: testing private CredentialStore path" {
|
It "testing private CredentialStore path" {
|
||||||
if (Test-Path -Path (Get-DefaultCredentialStorePath)) {
|
if (Test-Path -Path (Get-DefaultCredentialStorePath)) {
|
||||||
Remove-Item -Path (Get-DefaultCredentialStorePath)
|
Remove-Item -Path (Get-DefaultCredentialStorePath)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user