コード例 #1
0
        /// <summary>
        /// Inheritors can override this if they wish to create a custom application context
        /// </summary>
        protected virtual void SetupApplicationContext()
        {
            var applicationContext = CreateApplicationContext();

            ApplicationContext.Current = applicationContext;

            // FileSystemProviderManager captures the current ApplicationContext ScopeProvider
            // in its current static instance (yea...) so we need to reset it here to ensure
            // it is using the proper ScopeProvider
            FileSystemProviderManager.ResetCurrent();
        }
コード例 #2
0
        public void Setup()
        {
            //init the config singleton
            var config = SettingsForTests.GetDefault();

            SettingsForTests.ConfigureSettings(config);

            // media fs wants this
            ApplicationContext.Current = new ApplicationContext(CacheHelper.CreateDisabledCacheHelper(), new ProfilingLogger(Mock.Of <ILogger>(), Mock.Of <IProfiler>()));

            // start clean
            // because some tests will create corrupt or weird filesystems
            FileSystemProviderManager.ResetCurrent();
        }
コード例 #3
0
        private void ConfigureFileSystemProviders(Configuration config)
        {
            var fileSystems = (FileSystemProvidersSection)config.GetSection("umbracoConfiguration/FileSystemProviders");

            FileSystemProviderManager.SetCurrent(new FileSystemProviderManager(fileSystems));
        }
コード例 #4
0
 public void TearDown()
 {
     // stay clean (see note in SetUp)
     FileSystemProviderManager.ResetCurrent();
 }