-
Notifications
You must be signed in to change notification settings - Fork 47
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
Autofac does not register open generic in test project #99
Comments
I'm going to close this and recommend you do one or more of these things:
Basically, there's not a bug in Autofac here - if your test isn't wiring up the things into the container at the right spot, that's a problem with your code in the test or test setup. The |
Fair enough, thanks for taking a look.
…On Wed, 2 Feb 2022, 7:46 pm Travis Illig, ***@***.***> wrote:
Closed #99
<#99>
.
—
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFZQTKBJF7AKOMCXY5I2WN3UZE7UHANCNFSM5NLEAKBQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
<autofac/Autofac.Extensions.
***@***.***>
|
Describe the bug
I am trying to use autofac to register my open bound generic Mediator handlers, which works in my main project but does not in my tests(using Mytest.Aspnet.Mvc library)
My constraints are to class which inherits my main layout Model.
Full exception with stack trace:
Message:
MyTested.AspNetCore.Mvc.Exceptions.InvocationAssertionException : When calling Index action in UnitKeysController expected no exception but AggregateException (containing InvalidOperationException with 'Handler was not found for request of type MediatR.IRequestHandler
2[Sunspot.Application.Main.Main+Query
1[Sunspot.Models.DTO.Dashboard.UnitRatesDTO],Result1[Sunspot.Models.DTO.Dashboard.UnitRatesDTO]]. Register your handlers with the container. See the samples in GitHub for examples.' message) was thrown without being caught. Stack Trace: InvocationValidator.CheckForException(Exception exception, String exceptionMessagePrefix) ActionResultTestBuilder
1.ShouldReturn()Assembly/dependency versions:
Additional context
The text was updated successfully, but these errors were encountered: