Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Testing to FeedbackProvider Tutorial #10666

Open
JustinGrote opened this issue Nov 20, 2023 · 1 comment
Open

Add Testing to FeedbackProvider Tutorial #10666

JustinGrote opened this issue Nov 20, 2023 · 1 comment
Labels
area-sdk-docs Area - SDK docs

Comments

@JustinGrote
Copy link

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

@JustinGrote JustinGrote added the needs-triage Waiting - Needs triage label Nov 20, 2023
@sdwheeler sdwheeler added area-sdk-docs Area - SDK docs and removed needs-triage Waiting - Needs triage labels Nov 27, 2023
@sdwheeler
Copy link
Contributor

@JustinGrote I think this should be a standalone article that links to/from the existing tutorial. Could you write a draft?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-sdk-docs Area - SDK docs
Projects
None yet
Development

No branches or pull requests

2 participants