Example #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();
        }
        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();
        }
 public void TearDown()
 {
     // stay clean (see note in SetUp)
     FileSystemProviderManager.ResetCurrent();
 }