From 0417ecd9f61451325bd13d8eae6763a7566f23d8 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 21 Mar 2018 12:02:17 +0100 Subject: [PATCH] fix pscredential mocking --- tests/Item/02_New-CredentialStoreItem.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Item/02_New-CredentialStoreItem.Tests.ps1 b/tests/Item/02_New-CredentialStoreItem.Tests.ps1 index 4ed64f7..01c6266 100644 --- a/tests/Item/02_New-CredentialStoreItem.Tests.ps1 +++ b/tests/Item/02_New-CredentialStoreItem.Tests.ps1 @@ -73,9 +73,9 @@ Describe "New-CredentialStoreItem" { } } Context "Test optional parameter lookup" { - $UserName = 'myUser' - $Password = ConvertTo-SecureString -String "mypasswd" -AsPlainText -Force Mock Get-Credential { + $UserName = 'testuser' + $Password = ConvertTo-SecureString -String "mypasswd" -AsPlainText -Force return [PSCredential]::new($UserName, $Password) } @@ -83,7 +83,7 @@ Describe "New-CredentialStoreItem" { $tmpCS = 'C:\CredentialStore.json' New-CredentialStoreItem -Path $tmpCs -Shared -RemoteHost 'foobar3' $writtenItem = Get-CredentialStoreItem -Path $tmpCS -Shared -RemoteHost 'foobar3' - $writtenItem.UserName | Should -Be "myUser" + $writtenItem.UserName | Should -Be "testuser" } } Context "General Exception handling" {