@@ -246,7 +246,7 @@ param (
246246 {
247247 Write-Verbose - Message $file.fullname
248248 $testName = Get-TestFromScript - scriptPath $file.FullName
249- new-OperationValidationInfo - FilePath $file.Fullname - File $file.Name - Type $dir - Name $testName - Module $Module
249+ new-OperationValidationInfo - FilePath $file.Fullname - File $file.Name - Type $dir - Name $testName - ModuleName $Module
250250 }
251251 }
252252 }
@@ -305,7 +305,7 @@ function Invoke-OperationValidation
305305 [CmdletBinding (SupportsShouldProcess = $true , DefaultParameterSetName = " FileAndTest" )]
306306 param (
307307 [Parameter (ParameterSetName = " Path" , ValueFromPipelineByPropertyName = $true )][string []]$testFilePath ,
308- [Parameter (ParameterSetName = " FileAndTest" , ValueFromPipeline = $true )][hashtable []]$TestInfo ,
308+ [Parameter (ParameterSetName = " FileAndTest" , ValueFromPipeline = $true )][pscustomobject []]$TestInfo ,
309309 [Parameter (ParameterSetName = " UseGetOperationTest" )][string []]$ModuleName = " *" ,
310310 [Parameter (ParameterSetName = " UseGetOperationTest" )]
311311 [ValidateSet (" Simple" , " Comprehensive" )][string []]$TestType = @ (" Simple" , " Comprehensive" ),
@@ -331,7 +331,8 @@ function Invoke-OperationValidation
331331 {
332332 if ( $PSCmdlet.ParameterSetName -eq " UseGetOperationTest" )
333333 {
334- Get-OperationValidation - ModuleName $ModuleName - TestType $TestType | Invoke-OperationValidation - IncludePesterOutput:$IncludePesterOutput
334+ $tests = Get-OperationValidation - ModuleName $ModuleName - TestType $TestType
335+ $tests | Invoke-OperationValidation - IncludePesterOutput:$IncludePesterOutput
335336 return
336337 }
337338
@@ -347,17 +348,17 @@ function Invoke-OperationValidation
347348 # first check to be sure all of the TestInfos are sane
348349 foreach ($ti in $testinfo )
349350 {
350- if ( ! ($ti.ContainsKey ( " TestFilePath " ) -and $ti.ContainsKey ( " TestName " ) ))
351+ if ( ! ($ti.FilePath -and $ti.Name ))
351352 {
352353 throw " TestInfo must contain the path and the list of tests"
353354 }
354355 }
355356
356- write-verbose - Message (" EXECUTING: {0} {1}" -f $ti.TestFilePath , ($ti.TestName -join " ," ))
357- foreach ($tname in $ti.TestName )
357+ write-verbose - Message (" EXECUTING: {0} {1}" -f $ti.FilePath , ($ti.Name -join " ," ))
358+ foreach ($tname in $ti.Name )
358359 {
359- $testResult = Invoke-pester - Path $ti.TestFilePath - TestName $tName - quiet:$quiet - PassThru
360- Add-member - InputObject $testResult - MemberType NoteProperty - Name Path - Value $ti.TestFilePath
360+ $testResult = Invoke-pester - Path $ti.FilePath - TestName $tName - quiet:$quiet - PassThru
361+ Add-member - InputObject $testResult - MemberType NoteProperty - Name Path - Value $ti.FilePath
361362 Convert-TestResult $testResult
362363 }
363364 return
@@ -391,7 +392,7 @@ Function Convert-TestResult
391392 }
392393 $Module = $result.Path.split ([io.path ]::DirectorySeparatorChar)[-4 ]
393394 $TestName = " {0}:{1}:{2}" -f $testResult.Describe , $testResult.Context , $testResult.Name
394- New-OperationValidationResult - Module $Module - TestName $TestName - FileName $result.path - TestResult $testresult.result - RawResult $testResult - Error $TestError
395+ New-OperationValidationResult - Module $Module - Name $TestName - FileName $result.path - Result $testresult.result - RawResult $testResult - Error $TestError
395396 }
396397
397398}
0 commit comments