adds exception test for Get-CredentialStore

This commit is contained in:
OCram85 2018-03-13 16:01:37 +01:00
parent 9a4d50d097
commit f4bac76d60
1 changed files with 7 additions and 0 deletions

View File

@ -37,4 +37,11 @@ Describe "Get-CredentialStore" {
{ Get-CredentialStore -Path 'C:\foobar\CredentialStore.json' -Shared }| Should -Throw "Could not find the CredentialStore."
}
}
Context "Testing invalid json data" {
Mock Test-CredentialStore {return $true}
Mock Get-Content {return '"foo":"bar",'}
It "Should throw with invalid CredentialStore" {
{ Get-Credentialstore -Path "C:\dummy.json"} | Should -Throw "Unknown CredentialStore format. Invalid JSON file."
}
}
}