Add CommandExtensions with ExecuteIfCan on ICommand#65
Merged
Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/23610078-ec79-4398-83c3-16d1396956fa Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 18, 2026 19:55
View session
Tyrrrz
reviewed
Apr 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Ports CommandExtensions into PowerKit to provide a small convenience API for safely executing ICommand instances (source-only, no extra dependencies for supported TFMs).
Changes:
- Added
ICommand.ExecuteIfCan(object? parameter = null)extension method behind#if NETSTANDARD || NET. - Added unit tests covering executable vs non-executable command paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| PowerKit/Extensions/CommandExtensions.cs | Introduces ExecuteIfCan extension on ICommand, compiled only on NET/NETSTANDARD. |
| PowerKit.Tests/Extensions/CommandExtensionsTests.cs | Adds tests validating execute vs no-execute behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prime #65 +/- ##
==========================================
- Coverage 94.89% 94.35% -0.55%
==========================================
Files 120 124 +4
Lines 2332 2443 +111
Branches 177 196 +19
==========================================
+ Hits 2213 2305 +92
- Misses 85 97 +12
- Partials 34 41 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nventions Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/58585520-7442-4bef-b18e-8d3485491435 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
reviewed
Apr 18, 2026
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/8d14a025-bc10-4c26-936d-f391abffe2a5 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
approved these changes
Apr 18, 2026
This was referenced May 1, 2026
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FakeCommandto use callback delegates (Func<object?, bool>,Action<object?>) instead of stored state fields — matching theFakeObserver<T>pattern from ObservableTests