public void NewInstance_ClearInstance_AssemblyResolverIsDisposed()
        {
            DummyDisposable assemblyResolver = new DummyDisposable();

            try
            {
                AutomationSession session = AutomationSession.NewInstance(TestParameters, assemblyResolver);
                Assert.AreEqual(0, assemblyResolver.TimesDisposed);
            }
            finally
            {
                AutomationSession.ClearInstance();
                Assert.AreEqual(1, assemblyResolver.TimesDisposed);
            }
        }
        public void NewInstance_ClearInstance_AssemblyResolverIsDisposed()
        {
            using (ShimsContext.Create())
            {
                DummyDisposable assemblyResolver = new DummyDisposable();
                InitializeShims();

                try
                {
                    AutomationSession session = AutomationSession.NewInstance(TestParameters, assemblyResolver);
                    Assert.AreEqual(0, assemblyResolver.TimesDisposed);
                }
                finally
                {
                    AutomationSession.ClearInstance();
                    Assert.AreEqual(1, assemblyResolver.TimesDisposed);
                }
            }
        }