예제 #1
0
        public static void InvokeCodeActionList(this AbstractIntegrationTest test)
        {
            test.WaitForAsyncOperations(FeatureAttribute.SolutionCrawler);
            test.WaitForAsyncOperations(FeatureAttribute.DiagnosticService);

            test.VisualStudio.Instance.Editor.ShowLightBulb();
            test.VisualStudio.Instance.Editor.WaitForLightBulbSession();
            test.WaitForAsyncOperations(FeatureAttribute.LightBulb);
        }
예제 #2
0
 public static void InvokeNavigateToAndPressEnter(this AbstractIntegrationTest test, string text)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_GoToAll);
     test.VisualStudio.Instance.Editor.NavigateToSendKeys(text);
     test.WaitForAsyncOperations(FeatureAttribute.NavigateTo);
     test.VisualStudio.Instance.Editor.NavigateToSendKeys("{ENTER}");
 }
예제 #3
0
        public static void VerifyCurrentTokenType(AbstractIntegrationTest test, string tokenType, TextViewWindow_OutOfProc window)
        {
            test.WaitForAsyncOperations(
                FeatureAttribute.SolutionCrawler,
                FeatureAttribute.DiagnosticService,
                FeatureAttribute.Classification);
            var actualTokenTypes = window.GetCurrentClassifications();

            Assert.Equal(actualTokenTypes.Length, 1);
            Assert.Contains(tokenType, actualTokenTypes[0]);
            Assert.NotEqual("text", tokenType);
        }
예제 #4
0
        public static void VerifyCodeActions(
            this AbstractIntegrationTest test,
            IEnumerable <string> expectedItems,
            string applyFix       = null,
            bool verifyNotShowing = false,
            bool ensureExpectedItemsAreOrdered = false,
            FixAllScope?fixAllScope            = null,
            bool blockUntilComplete            = true)
        {
            test.VisualStudio.Instance.Editor.ShowLightBulb();
            test.VisualStudio.Instance.Editor.WaitForLightBulbSession();

            if (verifyNotShowing)
            {
                test.VerifyCodeActionsNotShowing();
                return;
            }

            var actions = test.VisualStudio.Instance.Editor.GetLightBulbActions();

            if (expectedItems != null && expectedItems.Any())
            {
                if (ensureExpectedItemsAreOrdered)
                {
                    TestUtilities.ThrowIfExpectedItemNotFoundInOrder(
                        actions,
                        expectedItems);
                }
                else
                {
                    TestUtilities.ThrowIfExpectedItemNotFound(
                        actions,
                        expectedItems);
                }
            }

            if (!string.IsNullOrEmpty(applyFix) || fixAllScope.HasValue)
            {
                test.VisualStudio.Instance.Editor.ApplyLightBulbAction(applyFix, fixAllScope, blockUntilComplete);

                if (blockUntilComplete)
                {
                    // wait for action to complete
                    test.WaitForAsyncOperations(FeatureAttribute.LightBulb);
                }
            }
        }
예제 #5
0
 public static void InvokeQuickInfo(this AbstractIntegrationTest test)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_QuickInfo);
     test.WaitForAsyncOperations(FeatureAttribute.QuickInfo);
 }
예제 #6
0
 public static void InvokeSignatureHelp(this AbstractIntegrationTest test)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_ParameterInfo);
     test.WaitForAsyncOperations(FeatureAttribute.SignatureHelp);
 }
예제 #7
0
 public static void InvokeCompletionList(AbstractIntegrationTest test)
 {
     test.ExecuteCommand(WellKnownCommandNames.Edit_ListMembers);
     test.WaitForAsyncOperations(FeatureAttribute.CompletionSet);
 }
예제 #8
0
 public static void SetPersistenceOption(this AbstractIntegrationTest test, bool value)
 {
     test.VisualStudio.Instance.VisualStudioWorkspace.SetPersistenceOption(value);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
예제 #9
0
 public static void SetOptionInfer(this AbstractIntegrationTest test, ProjectUtils.Project project, bool value)
 {
     test.VisualStudio.Instance.VisualStudioWorkspace.SetOptionInfer(project.Name, value);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
예제 #10
0
 public static void RemoveProjectReference(this AbstractIntegrationTest test, ProjectUtils.ProjectReference projectReferenceName, ProjectUtils.Project projectName)
 {
     test.VisualStudio.Instance.SolutionExplorer.RemoveProjectReference(projectName.Name, projectReferenceName.Name);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
예제 #11
0
 public static void AddMetadataReference(this AbstractIntegrationTest test, ProjectUtils.AssemblyReference referenceName, ProjectUtils.Project projectName)
 {
     test.VisualStudio.Instance.SolutionExplorer.AddMetadataReference(referenceName.Name, projectName.Name);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }