protected void CloseSolution() { SpinWait.SpinUntil(() => Dte.Solution.SolutionBuild.BuildState == vsBuildState.vsBuildStateDone || Dte.Solution.SolutionBuild.BuildState == vsBuildState.vsBuildStateNotStarted); VsHostedSpec.DoActionWithWaitAndRetry( () => Dte.Solution.Close(), 2000, 3, () => Dte.Solution.IsOpen); }
protected string OpenSolution(string solutionFile) { if (!Path.IsPathRooted(solutionFile)) { solutionFile = GetFullPath(TestContext.TestDeploymentDir, solutionFile); var tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); cleanupFolders.Add(tempPath); CopyAll(Path.GetDirectoryName(solutionFile), tempPath); solutionFile = Path.Combine(tempPath, Path.GetFileName(solutionFile)); } VsHostedSpec.DoActionWithWaitAndRetry( () => Dte.Solution.Open(solutionFile), 2000, 3, () => !Dte.Solution.IsOpen); return(solutionFile); }