Skip to content

add get-help tests for alias - #4895

Merged
Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
chunqingchen:helptest
Sep 28, 2017
Merged

Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
chunqingchen:helptest

Conversation

@chunqingchen

Copy link
Copy Markdown
Contributor

this is to resolve #4167

added help alias tests.

For other concerns of the issue:

  1. SaveTests are located at UpdatableHelpSystem.Tests.ps1

  2. Major methods of HelpProviderWithCache are never implemented as all the classes derived from the class have implemented override methods of SearchHelp and ExactMatchHelp:

\src\System.Management.Automation\help\CommandHelpProvider.cs(30): internal class CommandHelpProvider : HelpProviderWithCache
\src\System.Management.Automation\help\DscResourceHelpProvider.cs(15): internal class DscResourceHelpProvider : HelpProviderWithCache
\src\System.Management.Automation\help\HelpFileHelpProvider.cs(24): internal class HelpFileHelpProvider : HelpProviderWithCache
\src\System.Management.Automation\help\HelpProviderWithFullCache.cs(20): internal abstract class HelpProviderWithFullCache : HelpProviderWithCache
\src\System.Management.Automation\help\ProviderHelpProvider.cs(22): internal class ProviderHelpProvider : HelpProviderWithCache
\src\System.Management.Automation\help\PSClassHelpProvider.cs(15): internal class PSClassHelpProvider : HelpProviderWithCache

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can store the output of Get-Help wher? into a variable and then check for Category and Synopsis.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong

PS> get-help wher?


Name          : where
Category      : Alias
Synopsis      : Where-Object
Component     :
Role          :
Functionality :

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Get-Help where).Name | Should BeExactly "Where-Object" 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a test for '*' pattern? Maybe Get-Help spp*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, BeExactly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, BeExactly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@chunqingchen

Copy link
Copy Markdown
Contributor Author

thanks, your comment is resolved Aditya Patwardhan (@adityapatwardhan)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Remove-Item alias:\testAlias1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@chunqingchen

Copy link
Copy Markdown
Contributor Author

Aditya Patwardhan (@adityapatwardhan) your comment is resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit f83e238 into PowerShell:master Sep 28, 2017
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test for HelpSystem

4 participants