Created
March 19, 2018 12:31
-
-
Save lukos/cebf66e836b8ac5f8585ef81bf6e18fa to your computer and use it in GitHub Desktop.
RequestServices Mock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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