Exemple #1
0
        public override void SetUp()
        {
            base.SetUp();

            // FIXME: be able to get the UmbracoModule from the container. any reason settings were from testobjects?
            //create the module
            var logger         = Mock.Of <ILogger>();
            var globalSettings = TestObjects.GetGlobalSettings();
            var runtime        = new RuntimeState(logger, Mock.Of <IUmbracoSettingsSection>(), globalSettings,
                                                  new Lazy <IMainDom>(), new Lazy <IServerRegistrar>());

            _module = new UmbracoInjectedModule
                      (
                globalSettings,
                Mock.Of <IUmbracoContextAccessor>(),
                Factory.GetInstance <IPublishedSnapshotService>(),
                Factory.GetInstance <IUserService>(),
                new UrlProviderCollection(new IUrlProvider[0]),
                runtime,
                logger,
                null, // FIXME: PublishedRouter complexities...
                Mock.Of <IVariationContextAccessor>(),
                Mock.Of <IUmbracoContextFactory>()
                      );

            runtime.Level = RuntimeLevel.Run;


            //SettingsForTests.ReservedPaths = "~/umbraco,~/install/";
            //SettingsForTests.ReservedUrls = "~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd";
        }
Exemple #2
0
        public override void SetUp()
        {
            base.SetUp();

            // fixme - be able to get the UmbracoModule from the container. any reason settings were from testobjects?
            //create the module
            var logger         = Mock.Of <ILogger>();
            var globalSettings = TestObjects.GetGlobalSettings();
            var runtime        = new RuntimeState(logger, Mock.Of <IUmbracoSettingsSection>(), globalSettings,
                                                  new Lazy <IMainDom>(), new Lazy <IServerRegistrar>());

            _module = new UmbracoInjectedModule
                      (
                globalSettings,
                Mock.Of <IUmbracoContextAccessor>(),
                Factory.GetInstance <IPublishedSnapshotService>(),
                Factory.GetInstance <IUserService>(),
                new UrlProviderCollection(new IUrlProvider[0]),
                runtime,
                logger,
                null, // fixme - PublishedRouter complexities...
                Mock.Of <IVariationContextAccessor>()
                      );

            runtime.Level = RuntimeLevel.Run;


            //SettingsForTests.ReservedPaths = "~/umbraco,~/install/";
            //SettingsForTests.ReservedUrls = "~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd";

            Directory.CreateDirectory(Path.GetDirectoryName(IOHelper.MapPath(SystemFiles.NotFoundhandlersConfig, false)));

            //create the not found handlers config
            using (var sw = File.CreateText(IOHelper.MapPath(SystemFiles.NotFoundhandlersConfig, false)))
            {
                sw.Write(@"<NotFoundHandlers>
    <notFound assembly='umbraco' type='SearchForAlias' />
    <notFound assembly='umbraco' type='SearchForTemplate'/>
    <notFound assembly='umbraco' type='SearchForProfile'/>
    <notFound assembly='umbraco' type='handle404'/>
</NotFoundHandlers>");
            }
        }