Skip to content

Commit

Permalink
SqlLogin: Attempting to disable and already disabled login throws an …
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshKingWork committed Jul 20, 2023
1 parent 7260dfa commit ff04c9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ function Connect-SQL
$newObjectParameters = @{
TypeName = 'System.Management.Automation.ErrorRecord'
ArgumentList = @(
$invalidOperationException.ToString(),
$invalidOperationException,
'CS0001',
'InvalidOperation',
$databaseEngineInstance
Expand All @@ -642,7 +642,7 @@ function Connect-SQL
$newObjectParameters = @{
TypeName = 'System.Management.Automation.ErrorRecord'
ArgumentList = @(
$invalidOperationException.ToString(),
$invalidOperationException,
'CS0002',
'InvalidOperation',
$databaseEngineInstance
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/SqlServerDsc.Common.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' {
$mockErrorMessage = $mockLocalizedString -f 'localhost'

{ Connect-SQL -ServerName 'localhost' -ErrorAction 'Stop' } |
Should -Throw -ExpectedMessage ('System.InvalidOperationException: {0}*' -f $mockErrorMessage)
Should -Throw -ExpectedMessage $mockErrorMessage

Should -Invoke -CommandName New-Object -ParameterFilter {
$TypeName -eq 'Microsoft.SqlServer.Management.Smo.Server'
Expand Down

0 comments on commit ff04c9e

Please sign in to comment.