Skip to content

Instantly share code, notes, and snippets.

@lukos
Created March 19, 2018 12:31
Embed
What would you like to do?
Additional services mocks
servicesMock.Setup(sp => sp.GetService(typeof(IUrlHelperFactory))).Returns(new UrlHelperFactory());
servicesMock.Setup(sp => sp.GetService(typeof(ITempDataDictionaryFactory))).Returns(new TempDataDictionaryFactory(new SessionStateTempDataProvider()));
context.HttpContext.RequestServices = servicesMock.Object;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment