Skip to content

Commit f090d96

Browse files
committed
Refactor integration tests to check for null before restoring Agent XPs value
1 parent 9ae2ca3 commit f090d96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/Integration/Commands/Set-SqlDscConfigurationOption.Integration.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Describe 'Set-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integrat
4646

4747
AfterAll {
4848
# Restore the original Agent XPs value
49-
if ($script:originalAgentXPsValue)
49+
if ($null -ne $script:originalAgentXPsValue)
5050
{
5151
Set-SqlDscConfigurationOption -ServerObject $script:serverObject -Name 'Agent XPs' -Value $script:originalAgentXPsValue.RunValue -Force -ErrorAction 'SilentlyContinue'
5252
}

tests/Integration/Commands/Test-SqlDscConfigurationOption.Integration.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Describe 'Test-SqlDscConfigurationOption' -Tag @('Integration_SQL2017', 'Integra
4646

4747
AfterAll {
4848
# Restore the original Agent XPs value
49-
if ($script:originalAgentXPsValue)
49+
if ($null -ne $script:originalAgentXPsValue)
5050
{
5151
Set-SqlDscConfigurationOption -ServerObject $script:serverObject -Name 'Agent XPs' -Value $script:originalAgentXPsValue.RunValue -Force -ErrorAction 'SilentlyContinue'
5252
}

0 commit comments

Comments
 (0)