Skip to content

Commit

Permalink
fix tests that take too long
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Mar 11, 2019
1 parent 3fd8046 commit 81a926f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 1 addition & 6 deletions tests/Set-DbaMaxMemory.Tests.ps1
Expand Up @@ -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
Expand All @@ -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
}
}
}
8 changes: 1 addition & 7 deletions tests/Test-DbaMaxMemory.Tests.ps1
Expand Up @@ -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
Expand All @@ -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' {
Expand Down

0 comments on commit 81a926f

Please sign in to comment.