@@ -246,7 +246,7 @@ param (
246
246
{
247
247
Write-Verbose - Message $file.fullname
248
248
$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
250
250
}
251
251
}
252
252
}
@@ -305,7 +305,7 @@ function Invoke-OperationValidation
305
305
[CmdletBinding (SupportsShouldProcess = $true , DefaultParameterSetName = " FileAndTest" )]
306
306
param (
307
307
[Parameter (ParameterSetName = " Path" , ValueFromPipelineByPropertyName = $true )][string []]$testFilePath ,
308
- [Parameter (ParameterSetName = " FileAndTest" , ValueFromPipeline = $true )][hashtable []]$TestInfo ,
308
+ [Parameter (ParameterSetName = " FileAndTest" , ValueFromPipeline = $true )][pscustomobject []]$TestInfo ,
309
309
[Parameter (ParameterSetName = " UseGetOperationTest" )][string []]$ModuleName = " *" ,
310
310
[Parameter (ParameterSetName = " UseGetOperationTest" )]
311
311
[ValidateSet (" Simple" , " Comprehensive" )][string []]$TestType = @ (" Simple" , " Comprehensive" ),
@@ -331,7 +331,8 @@ function Invoke-OperationValidation
331
331
{
332
332
if ( $PSCmdlet.ParameterSetName -eq " UseGetOperationTest" )
333
333
{
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
335
336
return
336
337
}
337
338
@@ -347,17 +348,17 @@ function Invoke-OperationValidation
347
348
# first check to be sure all of the TestInfos are sane
348
349
foreach ($ti in $testinfo )
349
350
{
350
- if ( ! ($ti.ContainsKey ( " TestFilePath " ) -and $ti.ContainsKey ( " TestName " ) ))
351
+ if ( ! ($ti.FilePath -and $ti.Name ))
351
352
{
352
353
throw " TestInfo must contain the path and the list of tests"
353
354
}
354
355
}
355
356
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 )
358
359
{
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
361
362
Convert-TestResult $testResult
362
363
}
363
364
return
@@ -391,7 +392,7 @@ Function Convert-TestResult
391
392
}
392
393
$Module = $result.Path.split ([io.path ]::DirectorySeparatorChar)[-4 ]
393
394
$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
395
396
}
396
397
397
398
}
0 commit comments