Refactor invoker tests for reuse
This commit is contained in:
parent
b7db6dbc8e
commit
e7bd6cfc06
|
|
@ -47,6 +47,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
_controllerContext = controllerContext;
|
_controllerContext = controllerContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Internal for testing
|
||||||
|
internal ControllerContext ControllerContext => _controllerContext;
|
||||||
|
|
||||||
protected override void ReleaseResources()
|
protected override void ReleaseResources()
|
||||||
{
|
{
|
||||||
if (_controller != null && _cacheEntry.ControllerReleaser != null)
|
if (_controller != null && _cacheEntry.ControllerReleaser != null)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -248,15 +248,15 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
|
|
||||||
if (actionThrows)
|
if (actionThrows)
|
||||||
{
|
{
|
||||||
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest).GetMethod(
|
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest.TestController).GetMethod(
|
||||||
nameof(ControllerActionInvokerTest.ThrowingActionMethod));
|
nameof(ControllerActionInvokerTest.TestController.ThrowingActionMethod));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest).GetMethod(
|
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest.TestController).GetMethod(
|
||||||
nameof(ControllerActionInvokerTest.ActionMethod));
|
nameof(ControllerActionInvokerTest.TestController.ActionMethod));
|
||||||
}
|
}
|
||||||
actionDescriptor.ControllerTypeInfo = typeof(ControllerActionInvokerTest).GetTypeInfo();
|
actionDescriptor.ControllerTypeInfo = typeof(ControllerActionInvokerTest.TestController).GetTypeInfo();
|
||||||
|
|
||||||
return CreateInvoker(filters, actionDescriptor, _controller);
|
return CreateInvoker(filters, actionDescriptor, _controller);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue