public HtmlHelperExtensions_tests() { pageHelper = new MockPageHelper(); HtmlHelperExtensions.CreatePageHelper = _ => pageHelper; var viewContext = new ViewContext(); htmlHelper = new HtmlHelper(viewContext, new FakeViewDataContainer()); }
public void CreatePageHelperImpl_gets_page_helper_from_HttpContext_items() { var expectedPageHelper = new MockPageHelper(); htmlHelper.ViewContext.HttpContext = new FakeHttpContext(); htmlHelper.ViewContext.HttpContext.Items["Knapsack.PageHelper"] = expectedPageHelper; var pageHelper = HtmlHelperExtensions.CreatePageHelperImpl(htmlHelper); pageHelper.ShouldBeSameAs(expectedPageHelper); }