You need to sign in to do that
Don't have an account?
MUSFAR KT 6
Hi Can anyone help with the testclass for below code
public with sharing class fflib_QualifiedMethodAndArgValues
{
private final fflib_QualifiedMethod qm;
private final fflib_MethodArgValues args;
private final Object mockInstance;
public fflib_QualifiedMethodAndArgValues(fflib_QualifiedMethod qm, fflib_MethodArgValues args, Object mockInstance)
{
this.qm = qm;
this.args = args;
this.mockInstance = mockInstance;
}
public fflib_QualifiedMethod getQualifiedMethod()
{
return qm;
}
public fflib_MethodArgValues getMethodArgValues()
{
return args;
}
public Object getMockInstance()
{
return mockInstance;
}
public override String toString()
{
return qm + ' with args: [' + String.join(args.argValues, '],[') + ']';
}
}
{
private final fflib_QualifiedMethod qm;
private final fflib_MethodArgValues args;
private final Object mockInstance;
public fflib_QualifiedMethodAndArgValues(fflib_QualifiedMethod qm, fflib_MethodArgValues args, Object mockInstance)
{
this.qm = qm;
this.args = args;
this.mockInstance = mockInstance;
}
public fflib_QualifiedMethod getQualifiedMethod()
{
return qm;
}
public fflib_MethodArgValues getMethodArgValues()
{
return args;
}
public Object getMockInstance()
{
return mockInstance;
}
public override String toString()
{
return qm + ' with args: [' + String.join(args.argValues, '],[') + ']';
}
}
Here, in this case, the parameters that are passed in the constructor are not clear, i.e We need to create a record of the same type as the parameters passed in the constructor. If you are able to create a record of that type please provide it.
If the record is created, then you just need to call every function in the test class. and that's it, it will cover the whole class.
If You need to make a mock callout then you need to create a fake response for your requirement. Here is the example to create a mock response Here is the example for your reference to write the test class.
If this helped you please mark it as the best answer.
Thank you
Regards
Suraj Tripathi
Sorry to say, but I can't share my number. But I'm eager to help.
If the above explanation helped you please mark it as the best answer.
If you have any other query you can post them as a separate question.
Hope you will understand.
Thank You
Regards
Suraj Tripathi.