title: How to implement a custom delegate that is in a static class?
body: <p>I want to write a generic method that allows me to use a pattern of test methods that returns a boolean with the result and outputs a string message:</p>
  
  <pre><code>public delegate bool TestMethodDelegate&lt;string, bool&gt;(out string message);
  </code></pre>
  
  <p>I use it in a static class (and it is declared in that class):</p>
  
  <pre><code>public static void ExecuteTestMethodDelegate(TestDelegate&lt;string, bool&gt; aTestMethod)
  {
      // do repeated stuff before
      string message;
      bool result = aTestMethod(out message);
      // do repeated stuff after
  }
  </code></pre>
  
  <p>Now I want to call this method from multiple places in the code but can't get it right... tried several options, like:</p>
  
  <pre><code>string message;
  CommonTests.ExecuteTestMethodDelegate(() =&gt; return IsAppInstalled(out message));
  </code></pre>
  
  <p>Needless to say, this doesn't compile... any help will be appreciated.</p>