Skip to content

Instantly share code, notes, and snippets.

@lukos
Created March 19, 2018 12:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukos/cebf66e836b8ac5f8585ef81bf6e18fa to your computer and use it in GitHub Desktop.
Save lukos/cebf66e836b8ac5f8585ef81bf6e18fa to your computer and use it in GitHub Desktop.
RequestServices Mock
var servicesMock = new Mock<IServiceProvider>();
servicesMock.Setup(sp => sp.GetService(typeof(IAuthenticationService))).Returns(authManager.Object);
context.HttpContext.RequestServices = servicesMock.Object;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment