Fix Import-CliXml Tests (#5521)

Add checks that ProcessName is not null or empty.
This commit is contained in:
Mark Kraus
2017-11-22 13:34:05 +04:00
committed by Ilya
parent 9559694191
commit 7778941b40
@@ -125,7 +125,7 @@
Context "Import-CliXML" {
BeforeAll {
$gpsList = Get-Process powershell
$gpsList = Get-Process pwsh
$gps = $gpsList | Select-Object -First 1
$filePath = Join-Path $subFilePath 'gps.xml'
@@ -161,7 +161,9 @@
$fileContent | Should Not Be $null
$importedProcess = Import-Clixml $filePath
$importedProcess.ProcessName | Should Not BeNullOrEmpty
$gps.ProcessName | Should Be $importedProcess.ProcessName
$importedProcess.Id | Should Not BeNullOrEmpty
$gps.Id | Should Be $importedProcess.Id
}
@@ -173,7 +175,9 @@
$fileContent | Should Not Be $null
$importedProcess = Import-Clixml $filePath
$importedProcess.ProcessName | Should Not BeNullOrEmpty
$gps.ProcessName | Should Be $importedProcess.ProcessName
$importedProcess.Id | Should Not BeNullOrEmpty
$gps.Id | Should Be $importedProcess.Id
}