CommandAppTester overrides console #1713
byte2pixel
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been banging my head as to why my unit tests of a single command will pass with doing interactive things. I can create a
TestConsole()
and set.Interactive = true
and provide inputs and it works.But if I create an integration test using CommandAppTester no matter what I do I always get the console is not interactive.
What I found is that CommandAppTester ignores any console I try to provide.
Whether I try using dependency injection, or
app.ConfigureConsole
I found the reason why.
CommandAppTester doesn't use any configured console or check for one in the DI container it just creates a new one.
What I think should happen is maybe
configurator.Settings.Console
and if not thereThoughts?
If approved, I would be willing to create an issue and open a PR.
Beta Was this translation helpful? Give feedback.
All reactions