title: Write unit test for object.GetType().InvokeMember
body: <p>I have method with uses object.GetType().InvokeMember():</p>
  
  <pre><code>private void InvokeComObject(object callback, object parameter)
          {
              callback.GetType().InvokeMember(
                                  name: "[DispID=0]",
                                  invokeAttr: BindingFlags.Instance | BindingFlags.InvokeMethod,
                                  binder: null,
                                  target: callback,
                                  args: new Object[] { parameter == null ? "" : parameter });
          }
  </code></pre>
  
  <p>and a unit test for it:</p>
  
  <pre><code>[Test]
  public void should_execute_action()
  {
      var executor = CreateExecutor();
  
      Action&lt;int&gt; callback = Substitute.For&lt;Action&lt;int&gt;&gt;();
  
      executor.ExecuteAction("name", "value", callback);
  
      callback.Received(1).GetType().InvokeMember(Arg.Is&lt;string&gt;(r =&gt; r == "[DispID=0]"), 
          Arg.Is&lt;BindingFlags&gt;(r =&gt; r.HasFlag(BindingFlags.Instance) &amp;&amp; r.HasFlag(BindingFlags.InvokeMethod)), 
          Arg.Is&lt;Binder&gt;(r =&gt; r == null), Arg.Is&lt;object&gt;(r =&gt; ReferenceEquals(r, callback)), 
          Arg.Is&lt;Object[]&gt;(r =&gt; r == new Object[] { 2 }));
  }
  </code></pre>
  
  <p>executor.ExecuteAction inside executes InvokeComObject with "callback" which I passed to this method. This methods fails with exception on "callback.Received(1).GetType().InvokeMember":
  "System.ArgumentException: Must specify binding flags describing the invoke operation required (BindingFlags.InvokeMethod CreateInstance GetField SetField GetProperty SetProperty)."
  How can I make this test work?</p>