Пример #1
0
 public void CleanVsExperimentalInstance()
 {
     if (!_keepDirtyVsInstance)
     {
         // wait for removal of locks on some files we want to delete
         // TODO: find more reliable method than using Sleep()
         Thread.Sleep(TimeSpan.FromSeconds(1));
         VisualStudioInstance.Clean();
     }
     VisualStudioInstance = null;
 }
Пример #2
0
        public void SetupVanillaVsExperimentalInstance(string suffix, string typename)
        {
            AskIfNotOnBuildServerAndProductiveVs(suffix);

            try
            {
                VisualStudioInstance = new VsExperimentalInstance(TestMetadata.Versions.VS2015, suffix);
                if (string.IsNullOrEmpty(suffix))
                {
                    _keepDirtyVsInstance = true;
                    VisualStudioInstance.InstallExtension(_vsixPath);
                }
                else
                {
                    if (!_keepDirtyVsInstance)
                    {
                        _keepDirtyVsInstance = AskToCleanIfExists();
                    }
                    if (!_keepDirtyVsInstance)
                    {
                        VisualStudioInstance.FirstTimeInitialization();
                        VisualStudioInstance.InstallExtension(_vsixPath);
                    }
                }
            }
            // ReSharper disable once RedundantCatchClause
            // ReSharper disable once UnusedVariable
            catch (Exception exception)
            {
                var wrapper = new AutomationException(
                    $"Exception caught: {exception.GetType().Name}",
                    exception.Message,
                    exception);
                wrapper.LogAndThrow(typename);
            }
        }