public override void SetUp()
 {
     base.SetUp();
     UrlParser inner = GetInnerUrlParser();
     parser = new CachingUrlParserDecorator(inner, persister, wrapper, new CacheWrapper(persister, wrapper, new DatabaseSection()));
     CreateDefaultStructure();
 }
 public override void SetUp()
 {
     base.SetUp();
     UrlParser inner = GetInnerUrlParser();
     parser = new CachingUrlParserDecorator(inner, persister);
     CreateDefaultStructure();
 }
		public override void SetUp()
		{
			base.SetUp();
			UrlParser inner = TestSupport.Setup(persister, wrapper, host);
			parser = new CachingUrlParserDecorator(inner, persister, wrapper, new CacheWrapper(persister, wrapper, new DatabaseSection()));
			CreateDefaultStructure();
			repository = (FakeRepository<ContentItem>) persister.Repository;
		}
Example #4
0
		private void InitializeUrlParser(IServiceContainer container)
		{
			var config = container.Resolve<HostSection>();
			IUrlParser parser;
			if (config.MultipleSites)
				parser = new MultipleSitesParser(container.Resolve<IPersister>(), container.Resolve<IWebContext>(), container.Resolve<IHost>(), container.Resolve<Plugin.ConnectionMonitor>(), config);
			else
				parser = new UrlParser(container.Resolve<IPersister>(), container.Resolve<IWebContext>(), container.Resolve<IHost>(), container.Resolve<Plugin.ConnectionMonitor>(), config);

			if (config.Web.Urls.EnableCaching)
				parser = new CachingUrlParserDecorator(parser, container.Resolve<IPersister>(), container.Resolve<IWebContext>(), container.Resolve<CacheWrapper>());

			container.AddComponentInstance("n2.urlParser", typeof(IUrlParser), parser);
		}