public void LaunchAndGetVisualStudio() { var manager = VisualStudioManager.Instance; var logger = new MarkupStreamLogger(TestLog.Default); IVisualStudio visualStudio = manager.LaunchVisualStudio(VisualStudioVersion.Any, logger); Assert.IsNotNull(visualStudio, "Should have started an instance."); try { Assert.IsTrue(visualStudio.WasLaunched, "New instance launched so WasLaunched should be true."); AssertVisualStudioCanBeUsed(visualStudio); AssertExistingInstanceOfVisualStudioCanBeLocated(manager, logger, visualStudio.Version); } finally { visualStudio.Quit(); } }
public void GetVisualStudio_WhenLaunchFlagIsTrue_ProvidesAnInstanceOrStartsOne() { var manager = VisualStudioManager.Instance; var logger = new MarkupStreamLogger(TestLog.Default); IVisualStudio visualStudio = manager.GetVisualStudio(VisualStudioVersion.Any, true, logger); Assert.IsNotNull(visualStudio, "Should have found or started an instance."); try { AssertVisualStudioCanBeUsed(visualStudio); AssertExistingInstanceOfVisualStudioCanBeLocated(manager, logger, visualStudio.Version); } finally { if (visualStudio.WasLaunched) { visualStudio.Quit(); } } }