how can I mock out HttpContext in this extension method
public static class MyHtmlHelper
{
public static string GetFullPath(this HtmlHelper helper)
{
var url = HttpContext.Current.Request.Url;
return url.Scheme + "://" + url.AbsolutePath;
}
}
Create a HttpContextFactory, use that and then set it within your tests.
then in your code to this:
then in your tests use the property as a seam
where HttpMocks has the following and would be adjusted for your tests: