Skip to content

Add Testing to FeedbackProvider Tutorial #10666

Open
@JustinGrote

Description

@JustinGrote

Type of issue

Other (describe below)

Feedback

CC @sdwheeler @StevenBucher98

Ref: PowerShell/PowerShell#20722

Summary Process:

  1. Register the Feedback Provider
  2. Create a PowerShell Runspace and mock the commands you want to test (or don't)
  3. Invoke the command in the runspace
  4. Use FeedbackHub.GetFeedback() to get the results
  5. Filter to the ones generated by the provider
  6. Assert the correct item was produced

C# Example (Should be discouraged in favor of pester):
https://github.com/JustinGrote/MgAqDetect/blob/main/Test/FeedbackProvider.tests.cs

Pester Example:
https://github.com/JustinGrote/MgAqDetect/blob/main/Test/FeedbackProvider.tests.ps1

Page URL

https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/create-feedback-provider?view=powershell-7.3

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/docs-conceptual/dev-cross-plat/create-feedback-provider.md

Author

sdwheeler

Document Id

7ec77067-f2c9-46c7-040d-ad51eeb60caa

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions