Skip to content

Instantly share code, notes, and snippets.

@lukos
Created March 19, 2018 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukos/4636a6c81b0f5442fb593e58a3f45622 to your computer and use it in GitHub Desktop.
Save lukos/4636a6c81b0f5442fb593e58a3f45622 to your computer and use it in GitHub Desktop.
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