Move UpdateStack to separate interface to improve testing#328
Move UpdateStack to separate interface to improve testing#328geofflamrock merged 1 commit intomainfrom
Conversation
aa2aa45 to
9899e91
Compare
62d8c68 to
5ffcb2c
Compare
9899e91 to
cf8c123
Compare
5ffcb2c to
0e7f1e2
Compare
0e7f1e2 to
5614c78
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the stack update functionality by moving StackHelpers.UpdateStack into a separate StackActions interface to improve testability. Commands now use the IStackActions interface instead of directly calling static methods, enabling easier unit testing without requiring full Git repositories.
- Moved
UpdateStackfunctionality fromStackHelperstoStackActionsclass - Updated multiple command handlers to use the new
IStackActionsinterface - Converted integration tests to unit tests using mocked dependencies
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| UpdateStackCommand.cs | Modified to use new StackActions interface with additional dependencies |
| SyncStackCommand.cs | Updated constructor to use new StackActions interface |
| PushStackCommand.cs | Updated StackActions constructor call with new parameters |
| PullStackCommand.cs | Updated StackActions constructor call with new parameters |
| StackHelpers.cs | Added GetUpdateStrategy method to extract strategy determination logic |
| StackActions.cs | Added UpdateStack method and supporting merge/rebase implementation |
| UpdateStackCommandHandlerTests.cs | Converted integration tests to unit tests using mocks |
| SyncStackCommandHandlerTests.cs | Converted integration tests to unit tests using mocks |
| StackHelpersTests.cs | Removed tests that were moved to StackActionsTests |
| StackActionsTests.cs | Added comprehensive unit tests for new UpdateStack functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| } | ||
|
|
||
| public void UpdateBranchLineUsingMerge( |
There was a problem hiding this comment.
The UpdateBranchLineUsingMerge method is marked as public but appears to be an internal implementation detail. Consider making it private to reduce the public API surface.
| public void UpdateBranchLineUsingMerge( | |
| private void UpdateBranchLineUsingMerge( |
5614c78 to
b8526c1
Compare
Moves
StackHelpers.UpdateStackintoStackActionsto improve the ability to test commands without needing to have a full Git repo.Part of a series of PRs: