Exemple #1
0
        public void ReturnRouteInstancesEvenWhenContextIsNull(Routes tab, ITabContext context)
        {
            context.Setup(x => x.GetRequestContext <HttpContextBase>()).Returns((HttpContextBase)null);

            System.Web.Routing.RouteTable.Routes.Clear();
            System.Web.Routing.RouteTable.Routes.Ignore("Test");

            var data = tab.GetData(context) as IList <RouteModel>;

            Assert.NotNull(data);
            Assert.Equal(System.Web.Routing.RouteTable.Routes.Count, data.Count);
        }
Exemple #2
0
        public void ReturnRouteInstancesEvenWhenContextIsNull(Routes tab, ITabContext context, RoutesInspector routeInspector, IInspectorContext routeInspectorContext)
        {
            context.Setup(x => x.GetRequestContext <HttpContextBase>()).Returns((HttpContextBase)null);

            System.Web.Routing.RouteTable.Routes.Clear();
            System.Web.Routing.RouteTable.Routes.Ignore("Test");

            routeInspectorContext.Setup(x => x.ProxyFactory).Returns(new CastleDynamicProxyFactory(routeInspectorContext.Logger, routeInspectorContext.MessageBroker, () => new ExecutionTimer(new Stopwatch()), () => new RuntimePolicy()));
            routeInspector.Setup(routeInspectorContext);

            var data = tab.GetData(context) as IList <RouteModel>;

            Assert.NotNull(data);
            Assert.Equal(System.Web.Routing.RouteTable.Routes.Count, data.Count);
        }
Exemple #3
0
        public void ReturnRouteInstancesEvenWhenContextIsNull(Routes tab, ITabContext context, RoutesInspector routeInspector, IInspectorContext routeInspectorContext)
        {
            context.Setup(x => x.GetRequestContext<HttpContextBase>()).Returns((HttpContextBase)null);

            System.Web.Routing.RouteTable.Routes.Clear();
            System.Web.Routing.RouteTable.Routes.Ignore("Test");
             
            routeInspectorContext.Setup(x => x.ProxyFactory).Returns(new CastleDynamicProxyFactory(routeInspectorContext.Logger, routeInspectorContext.MessageBroker, () => new ExecutionTimer(new Stopwatch()), () => new RuntimePolicy()));
            routeInspector.Setup(routeInspectorContext);

            var data = tab.GetData(context) as IList<RouteModel>;

            Assert.NotNull(data);
            Assert.Equal(System.Web.Routing.RouteTable.Routes.Count, data.Count); 
        }
Exemple #4
0
        public void ReturnRouteInstancesEvenWhenContextIsNull(Routes tab, ITabContext context)
        {
            context.Setup(x => x.GetRequestContext<HttpContextBase>()).Returns((HttpContextBase)null);

            System.Web.Routing.RouteTable.Routes.Clear();
            System.Web.Routing.RouteTable.Routes.Ignore("Test");

            var data = tab.GetData(context) as IList<RouteModel>;

            Assert.NotNull(data);
            Assert.Equal(System.Web.Routing.RouteTable.Routes.Count, data.Count);
        }