diff --git a/tests/Set-DbaMaxMemory.Tests.ps1 b/tests/Set-DbaMaxMemory.Tests.ps1 index c433836efb..1359232715 100644 --- a/tests/Set-DbaMaxMemory.Tests.ps1 +++ b/tests/Set-DbaMaxMemory.Tests.ps1 @@ -5,7 +5,7 @@ Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan Describe "$CommandName Unit Tests" -Tags "UnitTests" { Context "Validate parameters" { [object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object {$_ -notin ('whatif', 'confirm')} - [object[]]$knownParameters = 'SqlInstance','SqlCredential','Max','InputObject','EnableException' + [object[]]$knownParameters = 'SqlInstance', 'SqlCredential', 'Max', 'InputObject', 'EnableException' $knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters It "Should only contain our specific parameters" { (@(Compare-Object -ReferenceObject ($knownParameters | Where-Object {$_}) -DifferenceObject $params).Count ) | Should Be 0 @@ -30,9 +30,4 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" { } } } - Context 'Validate input arguments' { - It 'SqlInstance parameter host cannot be found' { - Set-DbaMaxMemory -SqlInstance 'ABC' 3> $null | Should be $null - } - } } \ No newline at end of file diff --git a/tests/Test-DbaMaxMemory.Tests.ps1 b/tests/Test-DbaMaxMemory.Tests.ps1 index b204637a50..011ff7d2e9 100644 --- a/tests/Test-DbaMaxMemory.Tests.ps1 +++ b/tests/Test-DbaMaxMemory.Tests.ps1 @@ -5,7 +5,7 @@ Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan Describe "$commandname Integration Tests" -Tags "IntegrationTests" { Context "Validate parameters" { [object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object {$_ -notin ('whatif', 'confirm')} - [object[]]$knownParameters = 'SqlInstance','SqlCredential','Credential','EnableException' + [object[]]$knownParameters = 'SqlInstance', 'SqlCredential', 'Credential', 'EnableException' $knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters It "Should only contain our specific parameters" { (@(Compare-Object -ReferenceObject ($knownParameters | Where-Object {$_}) -DifferenceObject $params).Count ) | Should Be 0 @@ -24,12 +24,6 @@ Describe "$commandname Unit Tests" -Tag 'UnitTests' { Mock Get-DbaMaxMemory -MockWith { return $null } { Test-DbaMaxMemory -SqlInstance '' } | Should Throw } - - It 'SqlInstance parameter host cannot be found' { - Mock Get-DbaMaxMemory -MockWith { return $null } - Test-DbaMaxMemory -SqlInstance 'ABC' 3> $null | Should be $null - } - } Context 'Validate functionality - Single Instance' {