AutoMapper 10 has removed the public constructor from the ResolutionContext class (https://docs.automapper.org/en/stable/10.0-Upgrade-Guide.html#the-resolutioncontext-no-longer-has-a-public-constructor). I have previously been creating an instance to test a custom value resolver. Since I can no longer create an instance, how can I continue to test my value resolver which depends on a resolution context?
Asked
Active
Viewed 612 times
3
-
You could find out where the resolution context is initialized in AutoMapper source code and use to your needs if it's possible. Alternativly, use reflection to manually create an instance. – Prolog Aug 06 '20 at 18:47
-
1Why not simply do what the docs suggest? – Lucian Bargaoanu Aug 10 '20 at 05:24
-
Perhaps because it is not obvious what the docs mean? At least when the current writing is "You can test the entire Map operation." I have no idea what that means and how it helps me to test my resolver. Did you find a solution for this? – span Sep 13 '21 at 13:58