public override void TearDown()
        {
            var profilingLogger = Factory.GetService <IProfilingLogger>();
            var timer           = profilingLogger?.TraceDuration <TestWithDatabaseBase>("teardown"); // FIXME: move that one up

            try
            {
                // FIXME: should we first kill all scopes?
                if (Options.Database == UmbracoTestOptions.Database.NewSchemaPerTest)
                {
                    RemoveDatabaseFile();
                }

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

                // make sure we dispose of the service to unbind events
                PublishedSnapshotService?.Dispose();
                PublishedSnapshotService = null;
            }
            finally
            {
                timer?.Dispose();
            }

            base.TearDown();
        }
Esempio n. 2
0
 public override void TearDown()
 {
     if (_service == null)
     {
         return;
     }
     _service.Dispose();
     _service = null;
 }