Skip to content

Commit dab7ce4

Browse files
committed
Add tests for reading Inputs/Outputs of Maml help
1 parent 6166041 commit dab7ce4

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

test/Pester/ImportMamlHelp.Tests.ps1

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,30 @@ Describe "Import-YamlHelp tests" {
4646
$cmdlet.Metadata[$key] | Should -Be $Value
4747
}
4848
}
49+
50+
Context "Inputs/Outputs check" {
51+
It "has the proper Inputs for the '<name>' cmdlet" -testcases @(
52+
@{ name = 'Add-Member'; expectedValues = 'System.Management.Automation.PSObject' },
53+
@{ name = 'Get-PSBreakpoint'; expectedValues = 'System.Int32', 'Microsoft.PowerShell.Commands.BreakpointType' }
54+
) {
55+
param ([string]$name, [string[]]$expectedValues)
56+
57+
$values = $importedCmds.Where({$_.Title -eq $name}).Inputs.Typename
58+
$values | Should -BeExactly $expectedValues
59+
}
60+
61+
It "has the proper Outputs for the '<name>' cmdlet" -testcases @(
62+
@{ name = 'Add-Member'; expectedValues = 'None', 'System.Object' },
63+
@{ name = 'Get-PSBreakpoint'; expectedValues = 'System.Management.Automation.CommandBreakpoint',
64+
'System.Management.Automation.LineBreakpoint',
65+
'System.Management.Automation.VariableBreakpoint',
66+
'System.Management.Automation.Breakpoint' }
67+
) {
68+
param ([string]$name, [string[]]$expectedValues)
69+
70+
$values = $importedCmds.Where({$_.Title -eq $name}).Outputs.Typename
71+
$values | Should -BeExactly $expectedValues
72+
}
73+
}
4974
}
50-
}
75+
}

0 commit comments

Comments
 (0)