Exemple #1
0
        public void FindAllReferences_FormMultipleResults_ReturnsCorrectNumber()
        {
            var code    = @"
Public Sub DoSomething()
    Form1.Width = 20
    Form1.Height = 200
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).AddControl("TextBox1").Build();

            project.AddComponent(form.Component, form.CodeModule);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Component.Object);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                AssertParserReady(state);

                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(null, null, state, vm, null, uiDispatcher.Object));
                var target       = state.AllUserDeclarations.Single(s => s.IdentifierName == "Form1");

                command.Execute(target);

                Assert.AreEqual(1, vm.Tabs.Count);
                Assert.AreEqual(2, vm.Tabs[0].SearchResults.Count);
            }
        }
        public void FindAllReferences_ControlMultipleSelection_IsNotEnabled()
        {
            var code    = @"
Public Sub DoSomething()
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).AddControl("TextBox1").AddControl("TextBox2").Build();

            project.AddComponent(form);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Object);

            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(vbe.Object, new DeclarationFinderFactory()));

            AssertParserReady(parser);

            var targets = parser.State.AllUserDeclarations.Where(s => s.IdentifierName.StartsWith("TextBox"));
            var command = new FindAllReferencesCommand(null, null, parser.State, vbe.Object, null, null);


            Assert.IsFalse(command.CanExecute(targets));
        }
        public void FindAllReferences_FormNoResults_DisplaysMessageBox()
        {
            var code    = @"
Public Sub DoSomething()
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).Build();

            project.AddComponent(form);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Object);

            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(vbe.Object, new DeclarationFinderFactory()));

            AssertParserReady(parser);

            var messageBox = new Mock <IMessageBox>();

            messageBox.Setup(m =>
                             m.Show(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <MessageBoxButtons>(),
                                    It.IsAny <MessageBoxIcon>())).Returns(DialogResult.OK);

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, messageBox.Object, parser.State, vbe.Object, vm, null);
            var target  = parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "Form1");

            command.Execute(target);

            messageBox.Verify(m => m.Show(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <MessageBoxButtons>(),
                                          It.IsAny <MessageBoxIcon>()), Times.Once);
        }
        public void FindAllReferences_ControlMultipleResults_ReturnsCorrectNumber()
        {
            var code    = @"
Public Sub DoSomething()
    TextBox1.Height = 20
    TextBox1.Width = 200
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).AddControl("TextBox1").Build();

            project.AddComponent(form);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Object);

            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(vbe.Object, new DeclarationFinderFactory()));

            AssertParserReady(parser);

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, null, parser.State, vbe.Object, vm, null);
            var target  = parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "TextBox1");

            command.Execute(target);

            Assert.AreEqual(1, vm.Tabs.Count);
            Assert.AreEqual(2, vm.Tabs[0].SearchResults.Count);
        }
        public void FindAllReferences_ControlSingleResult_Navigates()
        {
            var code    = @"
Public Sub DoSomething()
    TextBox1.Height = 20
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).AddControl("TextBox1").Build();

            project.AddComponent(form);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Object);

            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(vbe.Object, new DeclarationFinderFactory()));

            AssertParserReady(parser);
            var navigateCommand = new Mock <INavigateCommand>();

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(navigateCommand.Object, null, parser.State, vbe.Object, vm, null);
            var target  = parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "TextBox1");

            command.Execute(target);

            navigateCommand.Verify(n => n.Execute(It.IsAny <object>()), Times.Once);
        }
Exemple #6
0
        public void FindAllReferences_ReferenceSelected_ReturnsCorrectNumber()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo: Foo
    Foo
    Foo
End Sub";

            //Arrange
            var         builder = new MockVbeBuilder();
            VBComponent component;
            var         vbe      = builder.BuildFromSingleStandardModule(inputCode, out component, new Selection(5, 5, 5, 5));
            var         mockHost = new Mock <IHostApplication>();

            mockHost.SetupAllProperties();
            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(new Mock <ISinks>().Object));

            parser.Parse(new CancellationTokenSource());
            if (parser.State.Status >= ParserState.Error)
            {
                Assert.Inconclusive("Parser Error");
            }

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, null, parser.State, vbe.Object, vm, null);

            command.Execute(null);

            Assert.AreEqual(4, vm.Tabs[0].SearchResults.Count);
        }
Exemple #7
0
        public void FindAllReferences_NoResults_DisplayMessageBox()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub";

            //Arrange
            var         builder = new MockVbeBuilder();
            VBComponent component;
            var         vbe      = builder.BuildFromSingleStandardModule(inputCode, out component);
            var         mockHost = new Mock <IHostApplication>();

            mockHost.SetupAllProperties();
            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(new Mock <ISinks>().Object));

            parser.Parse(new CancellationTokenSource());
            if (parser.State.Status >= ParserState.Error)
            {
                Assert.Inconclusive("Parser Error");
            }

            var messageBox = new Mock <IMessageBox>();

            messageBox.Setup(m =>
                             m.Show(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <MessageBoxButtons>(),
                                    It.IsAny <MessageBoxIcon>())).Returns(DialogResult.OK);

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, messageBox.Object, parser.State, vbe.Object, vm, null);

            command.Execute(parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

            messageBox.Verify(m => m.Show(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <MessageBoxButtons>(),
                                          It.IsAny <MessageBoxIcon>()), Times.Once);
        }
Exemple #8
0
        public void FindAllReferences_ReferenceSelected_ReturnsCorrectNumber()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo: Foo
    Foo
    Foo
End Sub";

            var vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _, new Selection(5, 5, 5, 5));

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(null, null, state, vm, null, uiDispatcher.Object));

                command.Execute(null);

                Assert.AreEqual(4, vm.Tabs[0].SearchResults.Count);
            }
        }
Exemple #9
0
        public void FindAllReferences_NullTarget_Aborts()
        {
            //Arrange
            var         builder = new MockVbeBuilder();
            VBComponent component;
            var         vbe = builder.BuildFromSingleStandardModule(string.Empty, out component);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);
            var mockHost = new Mock <IHostApplication>();

            mockHost.SetupAllProperties();
            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(new Mock <ISinks>().Object));

            parser.Parse(new CancellationTokenSource());
            if (parser.State.Status >= ParserState.Error)
            {
                Assert.Inconclusive("Parser Error");
            }

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, null, parser.State, vbe.Object, vm, null);

            command.Execute(null);

            Assert.IsFalse(vm.Tabs.Any());
        }
Exemple #10
0
        public void FindAllReferences_SingleResult_Navigates()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo
End Sub";

            //Arrange
            var         builder = new MockVbeBuilder();
            VBComponent component;
            var         vbe      = builder.BuildFromSingleStandardModule(inputCode, out component);
            var         mockHost = new Mock <IHostApplication>();

            mockHost.SetupAllProperties();
            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(new Mock <ISinks>().Object));

            parser.Parse(new CancellationTokenSource());
            if (parser.State.Status >= ParserState.Error)
            {
                Assert.Inconclusive("Parser Error");
            }

            var navigateCommand = new Mock <INavigateCommand>();

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(navigateCommand.Object, null, parser.State, vbe.Object, vm, null);

            command.Execute(parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

            navigateCommand.Verify(n => n.Execute(It.IsAny <object>()), Times.Once);
        }
Exemple #11
0
        public void FindAllReferences_FormSingleResult_Navigates()
        {
            var code            = @"
Public Sub DoSomething()
    Form1.Height = 20
End Sub
";
            var navigateCommand = new Mock <INavigateCommand>();
            var builder         = new MockVbeBuilder();
            var project         = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form            = project.MockUserFormBuilder("Form1", code).AddControl("TextBox1").Build();

            project.AddComponent(form.Component, form.CodeModule);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Component.Object);


            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                AssertParserReady(state);

                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(navigateCommand.Object, null, state, vm, null, uiDispatcher.Object));

                command.Execute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Form1"));

                navigateCommand.Verify(n => n.Execute(It.IsAny <object>()), Times.Once);
            }
        }
Exemple #12
0
        public void FindAllReferences_FormNoResults_DisplaysMessageBox()
        {
            var code    = @"
Public Sub DoSomething()
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).Build();

            project.AddComponent(form.Component, form.CodeModule);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Component.Object);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                AssertParserReady(state);

                var messageBox = new Mock <IMessageBox>();

                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(null, messageBox.Object, state, vm, null, uiDispatcher.Object));
                var target       = state.AllUserDeclarations.Single(s => s.IdentifierName == "Form1");

                command.Execute(target);

                messageBox.Verify(m => m.NotifyWarn(It.IsAny <string>(), It.IsAny <string>()), Times.Once);
            }
        }
Exemple #13
0
        public void FindAllReferences_ControlMultipleSelection_IsNotEnabled()
        {
            var code    = @"
Public Sub DoSomething()
End Sub
";
            var builder = new MockVbeBuilder();
            var project = builder.ProjectBuilder("TestProject1", ProjectProtection.Unprotected);
            var form    = project.MockUserFormBuilder("Form1", code).AddControl("TextBox1").AddControl("TextBox2").Build();

            project.AddComponent(form.Component, form.CodeModule);
            builder.AddProject(project.Build());
            var vbe = builder.Build();

            vbe.SetupGet(v => v.SelectedVBComponent).Returns(form.Component.Object);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                AssertParserReady(state);

                var targets      = state.AllUserDeclarations.Where(s => s.IdentifierName.StartsWith("TextBox"));
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, null, new FindAllReferencesService(null, null, state, null, null, uiDispatcher.Object));

                Assert.IsFalse(command.CanExecute(targets));
            }
        }
Exemple #14
0
        public void FindAllReferences_SingleResult_Navigates()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo
End Sub";

            var vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var navigateCommand = new Mock <INavigateCommand>();

                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(navigateCommand.Object, null, state, vm, null, uiDispatcher.Object));

                command.Execute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

                navigateCommand.Verify(n => n.Execute(It.IsAny <object>()), Times.Once);
            }
        }
Exemple #15
0
        public void FindAllReferences_CanExecute_StateNotReady()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo: Foo
    Foo
    Foo
End Sub";

            var vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                state.SetStatusAndFireStateChanged(this, ParserState.ResolvedDeclarations, CancellationToken.None);

                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(null, null, state, vm, null, uiDispatcher.Object));

                Assert.IsFalse(command.CanExecute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Foo")));
            }
        }
Exemple #16
0
        public void FindAllReferences_NoResults_DisplayMessageBox()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub";

            IVBComponent component;
            var          vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out component);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var messageBox = new Mock <IMessageBox>();
                messageBox.Setup(m =>
                                 m.Show(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <MessageBoxButtons>(),
                                        It.IsAny <MessageBoxIcon>())).Returns(DialogResult.OK);

                var vm      = new SearchResultsWindowViewModel();
                var command = new FindAllReferencesCommand(null, messageBox.Object, state, vbe.Object, vm, null);

                command.Execute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

                messageBox.Verify(m => m.Show(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <MessageBoxButtons>(),
                                              It.IsAny <MessageBoxIcon>()), Times.Once);
            }
        }
Exemple #17
0
        public void FindAllReferences_ReturnsCorrectNumber()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo: Foo
    Foo
    Foo
End Sub";

            IVBComponent component;
            var          vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out component);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var vm      = new SearchResultsWindowViewModel();
                var command = new FindAllReferencesCommand(null, null, state, vbe.Object, vm, null);

                command.Execute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

                Assert.AreEqual(4, vm.Tabs[0].SearchResults.Count);
            }
        }
Exemple #18
0
        public void FindAllReferences_StateNotReady_Aborts()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo: Foo
    Foo
    Foo
End Sub";

            IVBComponent component;
            var          vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out component);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                state.SetStatusAndFireStateChanged(this, ParserState.ResolvedDeclarations);

                var vm      = new SearchResultsWindowViewModel();
                var command = new FindAllReferencesCommand(null, null, state, vbe.Object, vm, null);

                command.Execute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

                Assert.IsFalse(vm.Tabs.Any());
            }
        }
Exemple #19
0
 protected override void Initialize()
 {
     base.Initialize();
     GoToDefinitionCommand.Initialize(this);
     FindAllReferencesCommand.Initialize(this);
     RenameCommand.Initialize(this);
     FindRefsWindowCommand.Initialize(this);
     Reformat.ReformatCommand.Initialize(this);
 }
        public void FindAllReferences_CanExecute_NullActiveCodePane()
        {
            IVBComponent component;
            var          vbe = MockVbeBuilder.BuildFromSingleStandardModule(string.Empty, out component);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);

            var state = MockParser.CreateAndParse(vbe.Object);

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, null, state, vbe.Object, vm, null);

            Assert.IsFalse(command.CanExecute(null));
        }
Exemple #21
0
        public void FindAllReferences_CanExecute_NullActiveCodePane()
        {
            var vbe = MockVbeBuilder.BuildFromSingleStandardModule(string.Empty, out _);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(null, null, state, vm, null, uiDispatcher.Object));

                Assert.IsFalse(command.CanExecute(null));
            }
        }
Exemple #22
0
        public void FindAllReferences_NullTarget_Aborts()
        {
            IVBComponent component;
            var          vbe = MockVbeBuilder.BuildFromSingleStandardModule(string.Empty, out component);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(null, null, state, vbe.Object, vm, null, uiDispatcher.Object);

                command.Execute(null);

                Assert.IsFalse(vm.Tabs.Any());
            }
        }
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            await base.InitializeAsync(cancellationToken, progress);

            // Attach to solution events
            solution = GetService(typeof(SVsSolution)) as IVsSolution;
            var re = solution.AdviseSolutionEvents(new SolutionEventListener(), out solutionEventsCookie);

            FindAllReferencesCommand.Initialize(this);
            FindRefsWindowCommand.Initialize(this);
            GoToDefinitionCommand.Initialize(this);
            GoToVisitorCommand.Initialize(this);
            NextSymCommand.Initialize(this);
            OptionsCommand.Initialize(this);
            ReformatCommand.Initialize(this);
            RenameCommand.Initialize(this);
            AboutCommand.Initialize(this);
        }
Exemple #24
0
        public void FindAllReferences_NoResults_DisplayMessageBox()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub";

            var vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _);

            using (var state = MockParser.CreateAndParse(vbe.Object))
            {
                var messageBox = new Mock <IMessageBox>();

                var vm           = new SearchResultsWindowViewModel();
                var uiDispatcher = new Mock <IUiDispatcher>();
                var command      = new FindAllReferencesCommand(state, vbe.Object, vm, new FindAllReferencesService(null, messageBox.Object, state, vm, null, uiDispatcher.Object));

                command.Execute(state.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

                messageBox.Verify(m => m.NotifyWarn(It.IsAny <string>(), It.IsAny <string>()), Times.Once);
            }
        }
Exemple #25
0
        public void FindAllReferences_StateNotReady_Aborts()
        {
            const string inputCode =
                @"Public Sub Foo()
End Sub

Private Sub Bar()
    Foo: Foo
    Foo
    Foo
End Sub";

            //Arrange
            var         builder = new MockVbeBuilder();
            VBComponent component;
            var         vbe = builder.BuildFromSingleStandardModule(inputCode, out component);

            vbe.Setup(s => s.ActiveCodePane).Returns(value: null);
            var mockHost = new Mock <IHostApplication>();

            mockHost.SetupAllProperties();
            var parser = MockParser.Create(vbe.Object, new RubberduckParserState(new Mock <ISinks>().Object));

            parser.Parse(new CancellationTokenSource());
            if (parser.State.Status >= ParserState.Error)
            {
                Assert.Inconclusive("Parser Error");
            }

            parser.State.SetStatusAndFireStateChanged(ParserState.ResolvedDeclarations);

            var vm      = new SearchResultsWindowViewModel();
            var command = new FindAllReferencesCommand(null, null, parser.State, vbe.Object, vm, null);

            command.Execute(parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "Foo"));

            Assert.IsFalse(vm.Tabs.Any());
        }
 public ReferenceCounterLabelMenuItem(FindAllReferencesCommand command)
     : base(command)
 {
     _caption = string.Empty;
 }
 public FindAllReferencesCommandMenuItem(FindAllReferencesCommand command)
     : base(command)
 {
 }
Exemple #28
0
 public ProjectExplorerFindAllReferencesCommandMenuItem(FindAllReferencesCommand command)
     : base(command)
 {
 }
Exemple #29
0
 protected FindAllReferencesCommandMenuItemBase(FindAllReferencesCommand command)
     : base(command)
 {
 }