From 9f9e895e6ed7afc8e5a0f5689a67d0a43a2db16f Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 28 Jun 2022 11:29:38 +0200 Subject: [PATCH] wip --- src/Item/New-CredentialStoreItem.Tests.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Item/New-CredentialStoreItem.Tests.ps1 b/src/Item/New-CredentialStoreItem.Tests.ps1 index dca488a..2b7a52a 100644 --- a/src/Item/New-CredentialStoreItem.Tests.ps1 +++ b/src/Item/New-CredentialStoreItem.Tests.ps1 @@ -79,14 +79,18 @@ Describe "New-CredentialStoreItem" { Context "General Exception handling" { Mock Test-CredentialStore { return $false } -ModuleName 'PSCredentialStore' It "Missing CredentialStore should throw" { - { New-CredentialStoreItem -Shared -Path '/tmp/missingStore.json' -RemoteHost 'notrelevant' } | Should -Throw "Could not add anything" + { + New-CredentialStoreItem -Shared -Path '/tmp/missingStore.json' -RemoteHost 'notrelevant' + } | Should -Throw "Could not add anything into the given CredentialStore." } } Context "Testing pipeline paramter" { It "Add the item with credential value from pipe" { $UserName = 'pipeUser' $Password = ConvertTo-SecureString -String "pipePasswd" -AsPlainText -Force - { [PSCredential]::new($UserName, $Password) | New-CredentialStoreItem -RemoteHost 'PipeHost' } | Should -Not -Throw + { + [PSCredential]::new($UserName, $Password) | New-CredentialStoreItem -RemoteHost 'PipeHost' + } | Should -Not -Throw } It "Testing written item" {