question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Invokes method with 5 arguments

See original GitHub issue

I’d like to call Invokes for method with 5 arguments (IDataRecord.GetBytes):

A.CallTo(() => dataRecord.GetBytes(10, A<long>._, A<byte[]>._, A<int>._, A<int>._))
 .Invokes((int i, long fieldOffset, byte[] buffer, int bufferOffset, int length) => {
        new Random().NextBytes(buffer);
 }).Returns(16);

But Invokes doesn’t support methods with 5 arguments 😦

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
thomaslevesquecommented, Nov 28, 2016

Thanks @ar7z1, but I agree with @blairconrad on this; we have to put a limit somewhere. Note that the convenience overloads of Invokes are defined as extension methods, so you can always declare more of them in your own code if you need them.

0reactions
ar7z1commented, Nov 28, 2016

@adamralph not at all! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Invoke Methods having Different Parameters
I am facing one issue in Invoking different methods which are having different types of parameter. For eg. I have 3 methods A,...
Read more >
Invoke with parameters?
Can someone help me? Is it possible to invoke a function while passing parameters? like: Invoke("mymethodname", parameter1, parameter2, ...
Read more >
Are there guidelines on how many parameters a function ...
I've never seen a guideline, but in my experience a function that takes more than three or four parameters indicates one of two...
Read more >
Python Function Examples – How to Declare and Invoke ...
This article will show you how to create and call your own Python functions. It will also give you an overview of how...
Read more >
How to write a function that accepts any number of ...
When you call a function in JavaScript, you can pass in any number of arguments, regardless of what the function declaration specifies. There...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found