You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing around and am curious how one would pass creds or a token in an integration test? Would it be more appropriate to do so in a test that invokes a authorized controller and goes through the traditional request pipeline? Is there a way I can pass along a user's context when testing specific commands and/or queries outside of that pipeline?
The text was updated successfully, but these errors were encountered:
You want to test invoking a Controller? I'm not sure what you mean.
One of the reasons to have a Controller that only calls MediatR and nothing else is to avoid having to worry about having ASP.NET Core in your testing. Testing your own code versus ASP.NET Core is more desirable.
If you're trying to assert that your configuration of ASP.NET Core is correct there is probably better ways to do that.
I'm more trying to assert that the CurrentUserAccessor middleware is working as expected, so I'd like to be able to make a request and provide a user context to ensure that I'm able to get the correct information from the user issuing the command. Does that make sense?
I'm playing around and am curious how one would pass creds or a token in an integration test? Would it be more appropriate to do so in a test that invokes a authorized controller and goes through the traditional request pipeline? Is there a way I can pass along a user's context when testing specific commands and/or queries outside of that pipeline?
The text was updated successfully, but these errors were encountered: