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

Interceptors and UnitTests issue #1655

Open
pirobox opened this issue Sep 24, 2024 · 0 comments
Open

Interceptors and UnitTests issue #1655

pirobox opened this issue Sep 24, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@pirobox
Copy link

pirobox commented Sep 24, 2024

Hi all,
I'm writing some unit tests for commands.
I'm trying to use the CommandAppTester helping class.
In my environment I was also adding an interceptor to the App

CommandAppTester app = new ();
app.Configure(config => config.SetInterceptor(new DummyInterceptor());
app.RunAsync(...)

But when the test doesn't use the DummyInterceptor because internally the CommandAppTester overrides it in this way
app.Configure(c => c.SetInterceptor(new CallbackCommandInterceptor((ctx, s) =>
{
context = ctx;
settings = s;
})));

Am I doing something wrong? Would it be possible to use interceptors in unit tests?

thanks in advance

@pirobox pirobox added bug Something isn't working needs triage labels Sep 24, 2024
@github-project-automation github-project-automation bot moved this to Todo 🕑 in Spectre Console Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
Status: Todo 🕑
Development

No branches or pull requests

1 participant