I am trying to invoke a private method of an object using private method. This method takes three arguments. Both signature of method i am trying to invoke and the code invoking this method are shown below
Signature of private method:
Public Class Foo
{
private void SaveCallback(SaveAggregationViewResponse response,
Action rollbackActionIfSaveFails,
Action postSaveActionOnSuccess)
{}
}
Code I am using to invoke method:
var foo=new Foo()
Private pFoo=new PrivateObject(foo);
var response=new SaveAggregationViewResponse();
pFoo.Invoke("SaveCallback",new object[]{response,(Action)null,(Action)null}); //this line throws exception
Exception Message:
Method 'Foo.SaveCallback' not found.
Is there something wrong with the way I am invoking private method or some other setup is wrong?
Thank You