Exemplo n.º 1
0
 public HtmlHelperExtensions_tests()
 {
     pageHelper = new MockPageHelper();
     HtmlHelperExtensions.CreatePageHelper = _ => pageHelper;
     var viewContext = new ViewContext();
     htmlHelper = new HtmlHelper(viewContext, new FakeViewDataContainer());
 }
Exemplo n.º 2
0
        public HtmlHelperExtensions_tests()
        {
            pageHelper = new MockPageHelper();
            HtmlHelperExtensions.CreatePageHelper = _ => pageHelper;
            var viewContext = new ViewContext();

            htmlHelper = new HtmlHelper(viewContext, new FakeViewDataContainer());
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }