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

            PluginManager.Current.AssembliesToScan = null;

            UmbracoSettings.ResetSetters();
        }
Exemple #2
0
        public static void Reset()
        {
            UmbracoSettings.ResetSetters();
            GlobalSettings.ResetCache();
            foreach (var kvp in SavedAppSettings)
            {
                ConfigurationManager.AppSettings.Set(kvp.Key, kvp.Value);
            }

            // set some defaults that are wrong in the config file?!
            // this is annoying, really
            HideTopLevelNodeFromPath = false;
        }
Exemple #3
0
        public virtual void TearDown()
        {
            if (ApplicationContext != null)
            {
                if (DatabaseContext != null && DatabaseContext.Database != null)
                {
                    DatabaseContext.Database.Dispose();
                }
                //reset the app context
                ApplicationContext.ApplicationCache.ClearAllCache();
            }

            SqlSyntaxContext.SqlSyntaxProvider = null;

            //legacy API database connection close - because a unit test using PetaPoco db-layer can trigger the usage of SqlHelper we need to ensure that a possible connection is closed.
            SqlCeContextGuardian.CloseBackgroundConnection();

            ApplicationContext.Current = null;
            Resolution.IsFrozen        = false;
            RepositoryResolver.Reset();
            SqlSyntaxProvidersResolver.Reset();

            TestHelper.CleanContentDirectories();

            string path = TestHelper.CurrentAssemblyDirectory;

            AppDomain.CurrentDomain.SetData("DataDirectory", null);

            SettingsForTests.Reset();
            UmbracoSettings.ResetSetters();

            try
            {
                string filePath = string.Concat(path, "\\UmbracoPetaPocoTests.sdf");
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error <BaseDatabaseFactoryTest>("Could not remove the old database file", ex);

                //We will swallow this exception! That's because a sub class might require further teardown logic.
            }
        }
Exemple #4
0
        public override void TearDown()
        {
            base.TearDown();

            //reset the app context
            DataTypesResolver.Reset();
            ApplicationContext.Current = null;
            Resolution.IsFrozen        = false;
            PluginManager.Current      = null;

            string path = TestHelper.CurrentAssemblyDirectory;

            AppDomain.CurrentDomain.SetData("DataDirectory", null);

            SerializationService = null;

            UmbracoSettings.ResetSetters();
        }
Exemple #5
0
        public override void TearDown()
        {
            base.TearDown();

            //TestHelper.ClearDatabase();

            //reset the app context
            DataTypesResolver.Reset();
            ApplicationContext.Current = null;
            Resolution.IsFrozen        = false;

            RepositoryResolver.Reset();

            string path = TestHelper.CurrentAssemblyDirectory;

            AppDomain.CurrentDomain.SetData("DataDirectory", null);

            UmbracoSettings.ResetSetters();
        }
 public void TearDown()
 {
     UmbracoSettings.ResetSetters();
 }