Пример #1
0
        public override void Initialize()
        {
            base.Initialize();

            var url = "/test";

            var lookup  = new Umbraco.Web.Routing.ContentFinderByNiceUrl();
            var lookups = new Umbraco.Web.Routing.IContentFinder[] { lookup };

            var t = Template.MakeNew("test", new User(0));

            var umbracoContext = GetUmbracoContext(url, t.Id);
            var urlProvider    = new UrlProvider(umbracoContext, new IUrlProvider[] { new DefaultUrlProvider() });
            var routingContext = new RoutingContext(
                umbracoContext,
                lookups,
                new FakeLastChanceFinder(),
                urlProvider);

            //assign the routing context back to the umbraco context
            umbracoContext.RoutingContext = routingContext;

            ////assign the routing context back to the umbraco context
            //umbracoContext.RoutingContext = routingContext;
            Umbraco.Web.UmbracoContext.Current = routingContext.UmbracoContext;
        }
        public override void Initialize()
        {
            base.Initialize();

            //generate new mock settings and assign so we can configure in individual tests
            _umbracoSettings = SettingsForTests.GenerateMockSettings();
            SettingsForTests.ConfigureSettings(_umbracoSettings);

            var url = "/test";

            var lookup  = new Umbraco.Web.Routing.ContentFinderByNiceUrl();
            var lookups = new Umbraco.Web.Routing.IContentFinder[] { lookup };

            var t = Template.MakeNew("test", new User(0));

            var umbracoContext = GetUmbracoContext(url, t.Id);
            var urlProvider    = new UrlProvider(umbracoContext, _umbracoSettings.WebRouting, new IUrlProvider[] { new DefaultUrlProvider() });
            var routingContext = new RoutingContext(
                umbracoContext,
                lookups,
                new FakeLastChanceFinder(),
                urlProvider);

            //assign the routing context back to the umbraco context
            umbracoContext.RoutingContext = routingContext;

            ////assign the routing context back to the umbraco context
            //umbracoContext.RoutingContext = routingContext;
            Umbraco.Web.UmbracoContext.Current = routingContext.UmbracoContext;
        }
		public override void Initialize()
		{
			base.Initialize();

			var url = "/test";
			
			var lookup = new Umbraco.Web.Routing.ContentFinderByNiceUrl();
			var lookups = new Umbraco.Web.Routing.IContentFinder[] { lookup };

			var t = Template.MakeNew("test", new User(0));

			var umbracoContext = GetUmbracoContext(url, t.Id);
            var urlProvider = new UrlProvider(umbracoContext, new IUrlProvider[] { new DefaultUrlProvider() });
			var routingContext = new RoutingContext(
				umbracoContext,
				lookups,
				new FakeLastChanceFinder(),
                urlProvider);

			//assign the routing context back to the umbraco context
			umbracoContext.RoutingContext = routingContext;

			////assign the routing context back to the umbraco context
			//umbracoContext.RoutingContext = routingContext;
			Umbraco.Web.UmbracoContext.Current = routingContext.UmbracoContext;
		}