Skip to content

Commit

Permalink
Chnaged integration tests as mentioned in issue dsccommunity#1001
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Jan 7, 2018
1 parent 7c0d362 commit 63cf77d
Showing 1 changed file with 43 additions and 23 deletions.
66 changes: 43 additions & 23 deletions Tests/Integration/MSFT_SqlServerRole.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ try
}

It 'Should be able to call Get-DscConfiguration without throwing' {
{ Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down Expand Up @@ -121,10 +121,14 @@ try
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration
It 'Should be able to call Get-DscConfiguration without throwing' {
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
It 'Should have set the resource and all the parameters should match' {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down Expand Up @@ -165,10 +169,14 @@ try
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration
It 'Should be able to call Get-DscConfiguration without throwing' {
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
It 'Should have set the resource and all the parameters should match' {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down Expand Up @@ -212,10 +220,14 @@ try
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration
It 'Should be able to call Get-DscConfiguration without throwing' {
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
It 'Should have set the resource and all the parameters should match' {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down Expand Up @@ -259,10 +271,14 @@ try
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration
It 'Should be able to call Get-DscConfiguration without throwing' {
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
It 'Should have set the resource and all the parameters should match' {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down Expand Up @@ -311,10 +327,14 @@ try
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration
It 'Should be able to call Get-DscConfiguration without throwing' {
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
It 'Should have set the resource and all the parameters should match' {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down Expand Up @@ -359,13 +379,13 @@ try
}

It 'Should be able to call Get-DscConfiguration without throwing' {
{ Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw
{
$script:currentConfiguration = Get-DscConfiguration -Verbose -ErrorAction Stop
} | Should -Not -Throw
}

It 'Should have set the resource and all the parameters should match' {
$currentConfiguration = Get-DscConfiguration

$resourceCurrentState = $currentConfiguration | Where-Object -FilterScript {
$resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript {
$_.ConfigurationName -eq $configurationName
} | Where-Object -FilterScript {
$_.ResourceId -eq $resourceId
Expand Down

0 comments on commit 63cf77d

Please sign in to comment.