diff --git a/tests/Store/01_Get-CredentialStore.Tests.ps1 b/tests/Store/01_Get-CredentialStore.Tests.ps1 index e2d6b29..e52f147 100644 --- a/tests/Store/01_Get-CredentialStore.Tests.ps1 +++ b/tests/Store/01_Get-CredentialStore.Tests.ps1 @@ -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." + } + } }