public override void SetUp()
 {
     base.SetUp();
     persister = null;
     activator = null;
     repository = TestSupport.CreateVersionRepository(ref persister, ref activator, typeof(Items.NormalPage), typeof(Items.NormalItem));
     drafts = new DraftRepository(repository, new FakeCacheWrapper());
 }
Exemplo n.º 2
0
		public RequestPathProvider(IWebContext webContext, IUrlParser parser, IErrorNotifier errorHandler, HostSection config, DraftRepository draftRepository)
		{
			this.webContext = webContext;
			this.parser = parser;
			this.errorHandler = errorHandler;
			this.draftRepository = draftRepository;

			observeAllExtensions = config.Web.ObserveAllExtensions;
			rewriteEmptyExtension = config.Web.ObserveEmptyExtension;
			StringCollection additionalExtensions = config.Web.ObservedExtensions;
			if (additionalExtensions != null && additionalExtensions.Count > 0)
			{
				observedExtensions = new string[additionalExtensions.Count + 1];
				additionalExtensions.CopyTo(observedExtensions, 1);
			}
			observedExtensions[0] = config.Web.Extension;
			nonRewritablePaths = config.Web.Urls.NonRewritable.GetPaths(webContext);
		}
        public void TestFixtureSetUp()
        {
            var definitionProviders = TestSupport.SetupDefinitionProviders(new DefinitionMap(), typeof(NormalPage), typeof(NormalItem));
            var proxies = new N2.Persistence.Proxying.InterceptingProxyFactory();
            proxies.Initialize(definitionProviders.SelectMany(dp => dp.GetDefinitions()));

            itemRepository = new MongoContentItemRepository(
                databaseProvider = new MongoDatabaseProvider(TestSupport.CreateDependencyInjector(), proxies, new N2.Configuration.ConfigurationManagerWrapper("n2mongo"),
                definitionProviders,
                new AdaptiveContext()));

            persister = new ContentPersister(TestSupport.SetupContentSource(itemRepository), itemRepository);
            IRepository<ContentVersion> versionRepository = new MongoDbRepository<ContentVersion>(databaseProvider);
            repository = TestSupport.CreateVersionRepository(
                ref persister,
                ref activator,
                ref versionRepository,
                typeof(NormalPage), typeof(NormalItem));
            drafts = new DraftRepository(repository, new FakeCacheWrapper());
        }