public override void TearDown()
 {
     base.TearDown();
     SafeCallContext.Clear();
     FileSystems.ResetShadowId();
     ClearFiles();
 }
Esempio n. 2
0
        // invoked by the filesystems when shadowing
        public ShadowFileSystems(FileSystems fileSystems, Guid id)
        {
            _fileSystems = fileSystems;
            Id           = id;

            _fileSystems.BeginShadow(id);
        }
Esempio n. 3
0
        public void Setup()
        {
            _register = RegisterFactory.Create();

            var composition = new Composition(_register, new TypeLoader(), Mock.Of <IProfilingLogger>(), ComponentTests.MockRuntimeState(RuntimeLevel.Run));

            composition.Register(_ => Mock.Of <ILogger>());
            composition.Register(_ => Mock.Of <IDataTypeService>());
            composition.Register(_ => Mock.Of <IContentSection>());
            composition.RegisterUnique <IMediaPathScheme, UniqueMediaPathScheme>();

            composition.Configs.Add(SettingsForTests.GetDefaultGlobalSettings);
            composition.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings);

            composition.ComposeFileSystems();

            composition.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings);

            _factory = composition.CreateFactory();

            Current.Reset();
            Current.Factory = _factory;

            // make sure we start clean
            // because some tests will create corrupt or weird filesystems
            FileSystems.Reset();
        }
Esempio n. 4
0
        public void TearDown()
        {
            // stay clean (see note in Setup)
            FileSystems.Reset();

            Current.Reset();
            _register.DisposeIfDisposable();
        }