Imported .NET assembly containing method with "params" keyword

Patrick O.
Minden, NV

Oct 20, 2017
2 Posts

0  |  0  

Re: Imported .NET assembly containing method with "params" keyword

I've imported a .NET 4.5.2 assembly that has a method containing the "params" keyword:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/params

The specific signature looks like this:
public IXmlRpcResponse MethodCall(string methodName, params object[] parameters)


After importing the .NET assembly into ATEasy, it looks like this optional list of parameters is not being respected as the method signature still states the second parameter is required.
i.e.
"parameters: Val mscorlib.NetObject[]"
instead of
"parameters: [Val] mscorlib.NetObject[]"

Does anyone know if this is supported functionality in ATEasy v10 or if there's an alternative way of getting this functionality to work?

Sutton B.
Irvine, CA

Oct 23, 2017
9 Posts

0  |  0  

Re: Imported .NET assembly containing method with "params" keyword

Hi Patrick,

Try creating an ATEasy procedure that calls this method. For the procedure you can have the parameter be optional, but when calling the method it will use a default value if a parameter was not given.

More .Net support is being added in ATEasy v10, and the current pre-release of v10 has some of these new features like the Properties Grid Window. This functionality in particular is known and being looked at to add in the future.

Regards,
Sutton

Patrick O.
Minden, NV

Oct 23, 2017
2 Posts

0  |  0  

Re: Imported .NET assembly containing method with "params" keyword

Hello Sutton,

Thank you for the response. I've attempted what you've suggested and having the same problem with using ATEasy v10.0 Pre-release (Build 155.6)

Whilst debugging in ATEasy, the value of "parameters" when being passed to MethodCall has the following value:
[Val] mscorlib.NetObject[]={Nothing}

I know that "Nothing" is a special keyword in ATEasy but it doesn't appear this is being handled correctly on the .NET side. It appears that having the value of "Nothing" still counts as the array having a length of 1, which is incorrect.

Is there a way in ATEasy to create a truly empty array?



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]