Ejemplo n.º 1
0
        public void ProcessSelectionTest()
        {
            Agent.EnsureSolutionOpen();

            IVsTextView  view  = VLDocumentViewsManager.GetTextViewForFile(Agent.VBStringsTestFile1, true, true);
            IVsTextLines lines = VLDocumentViewsManager.GetTextLinesForFile(Agent.VBStringsTestFile1, false);

            GenericSelectionTest(Agent.BatchMoveCommand_Accessor, Agent.VBStringsTestFile1, view, lines, GetExpectedResultsFor);
        }
        public void ProcessSelectionTest2()
        {
            Agent.EnsureSolutionOpen();

            IVsTextView  view  = VLDocumentViewsManager.GetTextViewForFile(Agent.AspNetReferencesTestFile2, true, true);
            IVsTextLines lines = VLDocumentViewsManager.GetTextLinesForFile(Agent.AspNetReferencesTestFile2, false);

            GenericSelectionTest(Agent.BatchInlineCommand_Accessor, Agent.AspNetReferencesTestFile2, view, lines, GetExpectedResultsFor);
        }
Ejemplo n.º 3
0
        public void VBInlineTest()
        {
            Agent.EnsureSolutionOpen();

            VBInlineCommand_Accessor target = new VBInlineCommand_Accessor();
            Window window = Agent.GetDTE().OpenFile(null, Agent.VBReferencesTestFile1);

            IVsTextView  view     = VLDocumentViewsManager.GetTextViewForFile(Agent.VBReferencesTestFile1, true, true);
            IVsTextLines lines    = VLDocumentViewsManager.GetTextLinesForFile(Agent.VBReferencesTestFile1, false);
            var          expected = VBBatchInlineTest.GetExpectedResultsFor(Agent.VBReferencesTestFile1);

            RunTest(target, view, lines, expected);

            window.Detach();
            window.Close(vsSaveChanges.vsSaveChangesNo);
        }
Ejemplo n.º 4
0
        public void CSharpMoveTest()
        {
            Agent.EnsureSolutionOpen();

            CSharpMoveToResourcesCommand_Accessor target = new CSharpMoveToResourcesCommand_Accessor();
            Window window = Agent.GetDTE().OpenFile(null, Agent.CSharpStringsTestFile1);

            IVsTextView  view     = VLDocumentViewsManager.GetTextViewForFile(Agent.CSharpStringsTestFile1, true, true);
            IVsTextLines lines    = VLDocumentViewsManager.GetTextLinesForFile(Agent.CSharpStringsTestFile1, false);
            var          expected = CSharpBatchMoveTest.GetExpectedResultsFor(Agent.CSharpStringsTestFile1);

            RunTest(target, view, lines, expected);

            window.Detach();
            window.Close(vsSaveChanges.vsSaveChangesNo);
        }
Ejemplo n.º 5
0
        public void ProcessEmptySelectionTest()
        {
            Agent.EnsureSolutionOpen();

            BatchMoveCommand_Accessor target = Agent.BatchMoveCommand_Accessor;

            Window      window = Agent.GetDTE().OpenFile(null, Agent.VBStringsTestFile1);
            IVsTextView view   = VLDocumentViewsManager.GetTextViewForFile(Agent.VBStringsTestFile1, false, true);

            view.SetSelection(40, 17, 44, 26);

            List <CodeStringResultItem> emptyList = new List <CodeStringResultItem>();

            target.ProcessSelection(true);
            ValidateResults(emptyList, target.Results);
            Assert.IsFalse(VLDocumentViewsManager.IsFileLocked(Agent.VBStringsTestFile1));

            window.Detach();
            window.Close(vsSaveChanges.vsSaveChangesNo);
        }
Ejemplo n.º 6
0
        public void ProcessEmptySelectionTest()
        {
            Agent.EnsureSolutionOpen();

            DTE2 DTE = Agent.GetDTE();
            BatchInlineCommand_Accessor target = Agent.BatchInlineCommand_Accessor;

            Window      window = DTE.OpenFile(null, Agent.VBReferencesTestFile1);
            IVsTextView view   = VLDocumentViewsManager.GetTextViewForFile(Agent.VBReferencesTestFile1, false, true);

            view.SetSelection(28, 4, 35, 31);

            List <AbstractResultItem> emptyList = new List <AbstractResultItem>();

            target.ProcessSelection(true);
            ValidateResults(emptyList, target.Results);
            Assert.IsFalse(VLDocumentViewsManager.IsFileLocked(Agent.VBReferencesTestFile1));

            window.Detach();
            window.Close(vsSaveChanges.vsSaveChangesNo);
        }