Invoke() public method

public Invoke ( System.Guid group, int id, object inputArg, object &outputArg ) : Microsoft.R.Components.Controller.CommandResult
group System.Guid
id int
inputArg object
outputArg object
return Microsoft.R.Components.Controller.CommandResult
Ejemplo n.º 1
0
        private void RunGotoDefTestUserDefinedItem(string content, int startLineNumber, int startColumn, int finalCaretPosition) {
            TextViewMock tv = SetupTextView(content, startLineNumber, startColumn);
            var cmd = new GoToDefinitionCommand(tv, tv.TextBuffer, Substitute.For<IObjectViewer>(), Substitute.For<IRSession>());

            var o = new object();
            var result = cmd.Invoke(typeof(VSConstants.VSStd97CmdID).GUID, (int)VSConstants.VSStd97CmdID.GotoDefn, null, ref o);
            result.Should().Be(CommandResult.Executed);
            tv.Caret.Position.BufferPosition.Position.Should().Be(finalCaretPosition);
        }
Ejemplo n.º 2
0
        private void RunGotoDefTestInternalItem(string content, int startLineNumber, int startColumn, string itemName) {
            TextViewMock tv = SetupTextView(content, startLineNumber, startColumn);
            var session = Substitute.For<IRSession>();
            var viewer = Substitute.For<IObjectViewer>();

            viewer.ViewObjectDetails(session, REnvironments.GlobalEnv, itemName, itemName).Returns(Task.CompletedTask);
            var cmd = new GoToDefinitionCommand(tv, tv.TextBuffer, viewer, session);

            var o = new object();
            var result = cmd.Invoke(typeof(VSConstants.VSStd97CmdID).GUID, (int)VSConstants.VSStd97CmdID.GotoDefn, null, ref o);
            result.Should().Be(CommandResult.Executed);
            viewer.Received().ViewObjectDetails(session, REnvironments.GlobalEnv, itemName, itemName);
        }