title: Unit test for extension method using moq
body: <p>I have two extension method like the below,</p>
  
  <pre><code>public static string FindFirstValue(this ClaimsPrincipal principal, string claimType, bool throwIfNotFound = false)
  {
      string value = principal.FindFirst(claimType)?.Value;
      if (throwIfNotFound &amp;&amp; string.IsNullOrWhiteSpace(value))
      {
          throw new InvalidOperationException(
              string.Format(CultureInfo.InvariantCulture, "The supplied principal does not contain a claim of type {0}", claimType));
      }
  
      return value;
  }
  
  public static string GetObjectIdentifierValue(this ClaimsPrincipal principal, bool throwIfNotFound = true)
  {
      return principal.FindFirstValue("http://schemas.microsoft.com/identity/claims/objectidentifier", throwIfNotFound);
  }
  </code></pre>
  
  <p>I have heard it is impossible to unit test extension methods as they are static.
  Just wanted to check if anybody has an idea to unit test the above extension methods using Moq?</p>
  
  <p>Could anyone please point me to right direction?</p>