From 52aa4465a2e4951be80736af3f63f1bff8671730 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 14 Mar 2018 09:19:15 +0100 Subject: [PATCH] adds test for NewCredentialStore output exception --- tests/Store/01_New-CredentialStore.Tests.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Store/01_New-CredentialStore.Tests.ps1 b/tests/Store/01_New-CredentialStore.Tests.ps1 index dfc47b0..b9d2eee 100644 --- a/tests/Store/01_New-CredentialStore.Tests.ps1 +++ b/tests/Store/01_New-CredentialStore.Tests.ps1 @@ -92,6 +92,12 @@ Describe "New-CredentialStore" { {New-CredentialStore -Path $pCS -Shared -Force} | Should Not Throw } } + Context "Test exception handling" { + Mock Out-File {throw "foobar exception"} + It "JSON Converstion should fail and throw" { + { New-CredentialStore -Path "C:\dummy.json"} | Should -Throw + } + } } # Cleanup test stores and restore existing ones.