fix syntax error
This commit is contained in:
parent
b5aff1f45b
commit
82da4dc20a
@ -73,10 +73,11 @@ Describe "New-CredentialStoreItem" {
|
||||
}
|
||||
}
|
||||
Context "Test optional parameter lookup" {
|
||||
$UserName = 'myUser'
|
||||
$Password = ConvertTo-SecureString -String "mypasswd" -AsPlainText -Force
|
||||
Mock Get-Credential {
|
||||
return [PSCustomObject]@{
|
||||
UserName = 'myUser'
|
||||
Password = ConvertTo-SecureString -String "mypasswd" -AsPlainText -Force
|
||||
return [PSCredential]::new($UserName, $Password)
|
||||
|
||||
}
|
||||
}
|
||||
It "Test missing Credential" {
|
||||
@ -88,14 +89,13 @@ Describe "New-CredentialStoreItem" {
|
||||
}
|
||||
Context "General Exception handling" {
|
||||
Mock Test-CredentialStore {return $false}
|
||||
$UserName = 'myUser'
|
||||
$Password = ConvertTo-SecureString -String "mypasswd" -AsPlainText -Force
|
||||
Mock Get-Credential {
|
||||
return [PSCustomObject]@{
|
||||
UserName = 'myUser'
|
||||
Password = ConvertTo-SecureString -String "mypasswd" -AsPlainText -Force
|
||||
}
|
||||
return [PSCredential]::new($UserName, $Password)
|
||||
|
||||
}
|
||||
It "Missing CredentialStore should throw" {
|
||||
New-CredentialStoreItem -Path 'C:\missingStore.json' -RemoteHost 'notrelevant' | Should -Throw "Could not add anything"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user