From 6014f4bac347f57bcdfcf16ba80d97dc6d147155 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 13 Jan 2020 19:24:42 +0000 Subject: [PATCH] Correct case of $null special variable --- test/powershell/Language/Scripting/Indexer.Tests.ps1 | 4 ++-- .../Microsoft.PowerShell.Management/Set-Service.Tests.ps1 | 2 +- .../Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/powershell/Language/Scripting/Indexer.Tests.ps1 b/test/powershell/Language/Scripting/Indexer.Tests.ps1 index 378f2b3cee..5467c53de8 100644 --- a/test/powershell/Language/Scripting/Indexer.Tests.ps1 +++ b/test/powershell/Language/Scripting/Indexer.Tests.ps1 @@ -7,7 +7,7 @@ Describe 'Tests for indexers' -Tags "CI" { $hashtable["Hello"] | Should -BeExactly "There" } - It 'Accessing a Indexed property of a dictionary that does not exist should return $NULL' { + It 'Accessing a Indexed property of a dictionary that does not exist should return $null' { $hashtable = @{ "Hello"="There" } $hashtable["Hello There"] | Should -BeNullOrEmpty } @@ -19,7 +19,7 @@ Describe 'Tests for indexers' -Tags "CI" { $service.CimClassProperties["DisplayName"].Name | Should -BeExactly 'DisplayName' } - It 'Accessing a Indexed property of a CimClass that does not exist should return $NULL' -Skip:(-not $IsWindows) { + It 'Accessing a Indexed property of a CimClass that does not exist should return $null' -Skip:(-not $IsWindows) { $service = Get-CimClass -ClassName Win32_Service $service.CimClassProperties["Hello There"] | Should -BeNullOrEmpty diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 index 44eba212da..9065741910 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 @@ -82,7 +82,7 @@ Describe "Set/New/Remove-Service cmdlet tests" -Tags "Feature", "RequireAdminOnW param($parameter, $value, $script, $expectedNull) $setServiceCommand = [Microsoft.PowerShell.Commands.SetServiceCommand]::new() - if ($script -ne $Null) { + if ($script -ne $null) { $value = & $script } $setServiceCommand.$parameter = $value diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 index 45973d431c..d08fa455da 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 @@ -115,7 +115,7 @@ Describe "Stream writer tests" -Tags "CI" { (Compare-Object $result $returnValue -SyncWindow 0).length | Should -Be 0 } - It "Write-Information accepts `$Null" { + It "Write-Information accepts `$null" { $streamPath = Join-Path $testdrive information.txt $null | Write-Information -Tags myTag -ErrorAction Stop -InformationAction SilentlyContinue -InformationVariable i $i.Tags | Should -BeExactly "myTag"