Minimal changes to improve CLI testability.#8657
Merged
mitchdenny merged 3 commits intomainfrom Apr 10, 2025
Merged
Conversation
15354ed to
1e533c7
Compare
davidfowl
approved these changes
Apr 9, 2025
Contributor
davidfowl
left a comment
There was a problem hiding this comment.
Nice! Except for the excess use of tuples
Member
Author
|
Once 9.2 ships we can get to work on those |
davidfowl
reviewed
Apr 9, 2025
| async (context) => { | ||
| return await runner.GetAppHostInformationAsync(projectFile, cancellationToken); | ||
| }); | ||
| var appHostInformationResult = await InteractionUtils.ShowStatusAsync( |
Contributor
There was a problem hiding this comment.
This should also be an interface too right?
Member
Author
There was a problem hiding this comment.
It will be eventually. I'm just starting to gather up everything first to centralise the dependency
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR starts to lay the groundwork for improving our testing story for the CLI. It does a few things:
Introduces an
IDotNetCliRunnerso that we can mock out executing CLI commands. Adds a couple of test classes - one for each command and some plumbing to support creating the service collection.At the moment the test cases only cover making sure the
--helpcommand runs - a sort of smoke test.