Refactor invoker tests for reuse

This commit is contained in:
Ryan Nowak 2017-05-24 13:56:16 -07:00
parent b7db6dbc8e
commit e7bd6cfc06
4 changed files with 2487 additions and 2581 deletions

View File

@ -47,6 +47,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal
_controllerContext = controllerContext;
}
// Internal for testing
internal ControllerContext ControllerContext => _controllerContext;
protected override void ReleaseResources()
{
if (_controller != null && _cacheEntry.ControllerReleaser != null)

View File

@ -248,15 +248,15 @@ namespace Microsoft.AspNetCore.Mvc.Internal
if (actionThrows)
{
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest).GetMethod(
nameof(ControllerActionInvokerTest.ThrowingActionMethod));
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest.TestController).GetMethod(
nameof(ControllerActionInvokerTest.TestController.ThrowingActionMethod));
}
else
{
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest).GetMethod(
nameof(ControllerActionInvokerTest.ActionMethod));
actionDescriptor.MethodInfo = typeof(ControllerActionInvokerTest.TestController).GetMethod(
nameof(ControllerActionInvokerTest.TestController.ActionMethod));
}
actionDescriptor.ControllerTypeInfo = typeof(ControllerActionInvokerTest).GetTypeInfo();
actionDescriptor.ControllerTypeInfo = typeof(ControllerActionInvokerTest.TestController).GetTypeInfo();
return CreateInvoker(filters, actionDescriptor, _controller);
}

File diff suppressed because it is too large Load Diff